Reduce swf size

TwitterFacebook
Get flash to fully experience Pearltrees
I have a Flex application that seems larger than it should be. There is a lot of code in it, but not a lot of assets and it just seems large, but I'm not sure how to go about figuring out where the space is going. I know about the –link-report option, but it only gives the sizes of externally linked library classes. I'm very interested in seeing a report of the sizes of all the classes and resources in my application and it would be a huge bonus if I could also view their dependencies. Not knowing how the code is compiled I'm not sure if this is even possible, but it seems like it should since the compiler can give me the sizes of individual classes linked from other libraries.

Analyze the size of a SWF built in Flex

http://stackoverflow.com/questions/523089/any-way-to-analyze-the-size-of-a-swf-built-in-flex
The Flex compiler has a rarely used feature called “link-report”. Using this option instructs the compiler to create a report of all symbols that went into the compiled application as well as a list of all external references. The Reducing SWF file sizes livedocs-page has more information about link reports. or you would use “-link-report output.xml” as an option on the mxmlc command line. In either case, an XML file with all definitions will be created after the compiler successfully built the SWF-file. http://www.kahunaburger.com/2008/03/08/air-link-report-visualizer/

Link Report visualizer

http://joeberkovitz.com/blog/2007/04/08/secret-life-of-swfs/

Using SwfxPrinter

April 8, 2007 on 12:35 am | In Flex , Programming , Uncategorized | 15 Comments It’s apparently a well-kept secret, but the Flex SDK includes a very useful tool for examining the structure and contents of SWF files. The Java class flash.swf.tools.SwfxPrinter , which lives in the Flex 2 SDK’s lib/swfkit.jar library, is an undocumented utility that dumps AS3 SWF files as XML documents. These dumps can provide really useful insight into what is taking up space in a compiled AS3 Flash or Flex application.

Improving SWF Compression

With web games you want hits — lot's of hits. A million per month or more if possible. Of course this means lots of traffic. While broadband became faster and cheaper during the last couple of years, traffic is still somewhat expensive. In order to get a nicer cost/income ratio there are apparently two options: reduce the costs and/or increase the income. As you might have guessed I'm about to tackle the former with brute processing power. http://kaioa.com/node/87

Saving from 1% to 3% when compressing the zlib compression of swf. by nicolas Nov 30

How to reduce SWF filesize ?

http://stackoverflow.com/questions/4808023/how-to-reduce-swf-filesize-by-optimizing-the-code Consider looking into preloaders and modules. Without knowing your application, it's hard to be specific, but a custom preloader can sometimes help a lot with perceived download time. Let's face it, asking the user to idly stare at a progress bar is sad, and you can do better.
secureSWF can be a SWF optimization tool to create smaller SWF files and lighter to run Flash applications, by renaming identifiers to smaller names (to one or two characters), removing frame labels and metadata, and applying different code optimizing techniques.

secureSWF

http://www.kindi.com/swf-optimization.php

Maybe good to obfuscate the code, but I gained only 1% size. by nicolas Nov 30

$100 to $400 with: * Compacts SWF tags headers * Removes duplicate not-instructions * Removes duplicate export tags * Removes dead code blocks * Removes debugging information * Optimizes control flow statements by reducing the number of branches in the code. by nicolas Nov 29

Flash Optimizer

Seems focused on assets optimization. Not really useful. by nicolas Nov 30

Optimize with haXe