This content has been marked as final. Show 4 replies
Anybody have any idea how to do this?
its difficult to say. What did you like to load on demand?
You may can put it into another SWF and use the SWF loader, but if the code you want to load on demand require some code in the main swf it not usefull.
Can you seperate the code into different modules?
If yes, you load the module afterwards ( see ModuleLoader in mx.modules package )
You should look this up in the documentation:
creationCompleteEffect is a nice property to use at startup as well.
The newest version of the Flash Player caches the Flex framework, so the weight of your Flex application will be small (if you use Flex 3).
In our project, we have used <mx:Module> and <mx:ModuleLoader> to dynamically load a piece of content created with Flash using the Flex component kit for Flash CS3. Thanks to an Adobe consultant, we got this command line to create a module SWF from a MXML and a SWC.
mxmlc -library-path+=swc/Cairngorm.swc,swc/project.swc -output assets/modules/ProjectModule.swf ProjectModule.mxml
Where project.swc is the SWC created by the component kit, ProjectModule.swf is the module created by mxmlc and ProjectModule.mxml is the MXML that instantiate the Flash component and whose base node is <mx:Module>.