Optimizing Flash documents
As your document file size increases, so does its download time and playback speed. You can take a number of steps to prepare your document for optimal playback. As part of the publishing process, Flash automatically performs some optimization on documents: for example, it detects duplicate shapes on export and places them in the file only once, and it converts nested groups into single groups.
Before exporting a document, you can optimize it further by using various strategies to reduce the file size. You can also compress a SWF file as you publish it. (See Publishing.) As you make changes, it's a good idea to test your document by running it on a variety of different computers, operating systems, and Internet connections.
- Use symbols, animated or otherwise, for every element that appears more than once.
- When creating animation sequences, whenever possible use tweened animations, which take up less file space than a series of keyframes.
- For animation sequences, use movie clips instead of graphic symbols.
- Limit the area of change in each keyframe; make the action take place in as small an area as possible.
- Avoid animating bitmap elements; use bitmap images as background or static elements.
- For sound, use MP3, the smallest sound format, whenever possible.
- Group elements as much as possible.
- Use layers to separate elements that change over the course of the animation from those that do not.
- Use Modify > Curves > Optimize to minimize the number of separate lines that are used to describe shapes.
- Limit the number of special line types, such as dashed, dotted, ragged, and so on. Solid lines require less memory. Lines created with the Pencil tool require less memory than brush strokes.
- Limit the number of fonts and font styles. Use embedded fonts sparingly, because they increase file size.
- For Embed Fonts options, select only the characters needed instead of including the entire font.
- Use the Color menu in the symbol Property inspector to create many instances of a single symbol in different colors.
- Use the Color Mixer (Window > Color Mixer) to match the color palette of the document to a browser-specific palette.
- Use gradients sparingly. Filling an area with gradient color requires about 50 bytes more than filling it with solid color.
- Use alpha transparency sparingly; it can slow playback.