3 Replies Latest reply on Oct 19, 2009 9:25 PM by Flex harUI

    Multi-swf & single-swc vs single-swf & multi-module.

    Zen Seven Level 1

      Hello everyone.

       

      Please note all these obversations below were done with Flex 3.3 SDK.

       

      I'm looking for some clarification. And which is the better option?

       

      When I first started using Flex for my fairly large application, which comprised up several different swf files, I found lots of commentary in regards to using SWCs. Placing common code in a SWC project and compiling them seperately to eliminate redundancy. However through hours of experiementation I noticed that other than the code that you explicitly compiled in, SWCs didn't help in eliminating common resources required (images, styles) between swfs. The compiler still insisted on placing that embedded background jpeg in all of my swfs instead of having it live only in the swc file. FAIL. On top of that the hefty Flex SDK, which adds minimum 120 KB to your local swf, I expected those common dependancies to be placed in the SWC file and not in each individual SWF. But to this day I haven't found anyway of doing that.

       

      Enter modules. Seems that I might be able to pull off the same sort of behaviour my having a skeleton frame swf, which holds only the Flex SDK dependancies, and then load all other functionality required as seperate modules at runtime, whether it be new logic and/or embedded resources. As far as I understand the only caveat is memory management. I've seen various versions of the Flash player leak from version to version. I've also read that when you try to unload modules it's difficult to rip that out from Flash. So therefore it's more convienient, albeit not as elegant, to just "reboot" by restarting the swf in a different state.

       

      I'm wondering which is the better approach, and if anyone provide any insight on this before I choose which way to implement my next big Flex project.

       

      Thanks for your time.