Notes on Optimizing SWF File Size

Some general notes on cutting file size of SWF files:

  • Where possible try writing your own basic animation functions avoid the overhead of entire libraries. Try switching from TweenMax to TweenLite or TweenNano. This should save you at least 3KB per level down.
  • Reduce the number of vector shapes. For example, if you have masked animation, especially a slow reveal – redraw the reveal part without vector shapes. Use 1 mc and change it’s position, add more layers, and duplicate the mc instead. Do whatever you can to avoid adding an extra vector shape to your file.
  • Reduced the number of Fonts used in your file. Try playing w/ alpha to fake font weight, in some cases this works to make a font appear less prominent.
  • Replace larger transparent PNGs with non-transparent GIFs/JPEGs and mask out the negative space. Balance this with the costs of adding another vector shape for the mask.
  • Optimize JPEG & PNG-8 assets in Photoshop for best results (not in the Flash IDE’s Library panel). PNG-24 can be further optimized in the Library, if needed.
  • Externalize your content (images, text, video, etc) where possible.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s