This content has been marked as final. Show 3 replies
What you are describing sounds like a use-case for Flex 2 Modules. A Module is like an application in that it compiles to a SWF, but it cannot be run independently. Check the Flex 2 docs for Modules and I've got an example on my blog ( http://weblogs.macromedia.com/pent).
Thanks Peter, but there doesn't seem to be much documentation or examples for using Modules in this capacity. I understand you can load a module into an application at runtime but then what method would you use to load in your swf/class symbols and then use these assets in your application containers? Would the swf symbols be accessable to the entire application or just the module?
Also, what does it mean to "package" your swc's in a module. I've heard of this approach, but again, never seen any examples of this.
I've also seen older examples of using Loader and ApplicationDomain to load in embedded symbols of a flash movie. Would you recommen this or is there something else less cumbersome?
A "SWC" is a library of ActionScript classes. You can create one with Flex Builder by selecting a "Flex Library" project. A Module would simply use classes from the SWC (you add the SWC to your Module's build path) and then the resulting SWF would contain those classes. Note that only classes where are referenced by code in the module will be in the SWF.
Read up on ApplicationDomain, I think that will make it easier to understand how to use classes that are loaded dynamically.