Technology Article

About Luster Packages

Luster supports the importing and attaching of external Luster applications to a running Luster application. The running Luster application may load and attach the new application using the stage:attachMovie function call.

Here is sample code:

function Root:LoadCore()
    trace("Loading VT_Core")
    local tempLoader =
    tempLoader.dataFormat = "binary"
    local tempRequest ="../VT_Core/VT_Core.l3d.xml")--CommonData/l3d/VT_Core.l3d")
    tempLoader:addEventListener(, Function(self, self.LoadCoreComplete))

-- Create self.core (the VT_Core object)
function Root:LoadCoreComplete(e)
    trace("Loaded VT_Core")
    local coreClass = stage:attachMovie(e.request.url,, true)
    self.core = coreClass()
    -- Grab the SceneManager
    -- TODO: Organize this up a bit = luster.display.Camera() = 200
    self.sceneManager = vt.SceneManager:Instance()
    stage:getViewport(0).camera =

This code demonstrates the attaching of the external movie. It is first loaded using the class. Once the loaded event is called the code calls the attachMovie function. Note that the data must be binary form, whether or not the packaged l3d file format is used, or the development xml format is used. The return value from attachMovie is the root class from the attached movie, which you may then construct as any other class. This now gives you access to the loaded application. Once attached, the resources of the loaded movie are available in the original as if they were the original's resources.