charlesshoults
06-23-2009, 09:02 PM
What sort of sense does Flex make when it builds the swf files at compile-time? In my first experience building a project with Flex (no experience in Flash), I started out writing the entire thing as one file. I then learned to use external classes and externalize code into actionscript files. The file size was obviously enormous and just the act of writing code began to crawl. I then started using modules and external applications loaded through the SWFLoader. File sizes came down some, but not much.
At present, I have disabled most of my application and am working with just three swfs. My main mxml file loads the other two swf files as modules that are not optimized against the main application. Here's the trick. One of the functions of my main file was to set up a timer to fire off every 60 seconds, update two datagrids and a tree. I moved this code out of the main file and into one of the modules, reducing the main file by about 100 lines and removing the timer, URLLoader and ResultEvent. But when I exported a release build, the main swf actually increased by 16kb.
What the heck?
At present, I have disabled most of my application and am working with just three swfs. My main mxml file loads the other two swf files as modules that are not optimized against the main application. Here's the trick. One of the functions of my main file was to set up a timer to fire off every 60 seconds, update two datagrids and a tree. I moved this code out of the main file and into one of the modules, reducing the main file by about 100 lines and removing the timer, URLLoader and ResultEvent. But when I exported a release build, the main swf actually increased by 16kb.
What the heck?