FlexManiacs - Managing large applications with Modules - Jim Robson

In Flash it is normal to spread assets and code along the timeline so that it can load in a streaming fashion to increase performance. In Flex there is a download animation in frame 1 and everything else is normally loaded in frame 2. This can perform badly.

Jim told us how modules help with application performance because flex can load them as needed rather than having to load them all at the start.

Flex Tags for Modules

The <mx:Module> tag can be used to create a separate module for part of the code. It can then be called in the main application with a <mx:ModuleLoader> tag. The tag will download the module as soon as a URL is assigned to the url property. So it is best to assign it only if needed.

Within the module the parentAppliction can then be used to address the application which loaded the module.

To call the module you should really use an interface. This will make it more separated code, and be easier to maintain.

The chart is loaded then by the parent dispatching an event to load the child.

Optimising Modules

Don't use the classes that have been compiled in the application in the module. Compile without them as they are not needed.

You can use the link report to identify modules that you don't need.

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.