Let's talk SWF filesize for a moment. My current situation is that I'm building a Flash / HTML hybrid website and minimal filesize is still the name of the game for SWFs. On the page at hand I have 2 SWFs that talk to each other with ExternalInterface callbacks and fetch content using AJAX that loads bits into the page as well as the SWFs.
Flex 3 is the coder's tool of choice (above the Flash IDE anyway), but you have a number of ways to leverage that tool to result in a SWF. What's the right solution for my situation? I chose to begin with a straight forward Flex Project using MXML, and I couldn't have been more wrong.
MXML and AS code files are fine except for the shear weight of the SWFs plopped out of Flex. Holy cow! I've been searching for optimization tips to get the size down, and the best I can do for my current scenario is 148 KB. That's the Release Export's best on a good day with favorable winds. And it's completely unacceptable for a file that has nothing other than a Sprite, ExternalInterface, Loader and URLRequest. The debug version, even with the -optimize=true compile option enabled, chunks in at 240 KB.
I decided to try a Flex Actionscript Project instead and do without MXML. I coded up the exact same scenario in a single AS file and, poof, my SWF was 4 KB. That's more like it!
I'm still getting a feel for when and how to use a Flex
Project with an MXML Application. My current conclusion, subject to
change, is that Flex/MXML projects are best suited for an all Flex
application; in other words, NOT a hybrid HTML/Flash website where filesize really really counts.
The publish options in Flex are extremely thin and the documentation for compile options at Adobe.com is totally lacking. This really feels like a first generation product documentation and not a 3rd gen.
But at least I'm not coding in Flash CS3 any more, and I couldn't be happier about that.