R – Optimizing AS3 SWF files for size

actionscript-3flashoptimization

Are there any tips / best practices / secrets for optimizing the size of AS3 SWF files? In particular, any way to get a breakdown of what is taking up space inside the SWF, like you used to be able to in the old Flash 7/8 days? I'm not using the Flash IDE any more, but now I'm using either Flex Builder or FlashDevelop, so it needs to be something that I can do without the Flash IDE.

Best Answer

If you're interested what in the code is taking up space, you can get that information from the link report. It's not as detailed as what you can get out of the Flash IDE, but it shows the size of each class (uncompressed.)

To create a link report, use the -link-report <filename> flag on mxmlc. It creates an XML file with information about the classes linked into your SWF.

I used the .XSL file described in the link below to clean it up and make it more readable: http://blog.iconara.net/2007/02/25/visualizing-mxmlcs-link-report/

Related Topic