Optimize Graphics

Flash's ubiquity is largely attributable to the small download size of the Flash Player and the ability to create low-bandwidth content. However, the filesize optimization comes at the cost of reduced performance as you increase complexity.

Vectors graphics are more compact than other image formats because vectors define the math (points, curves, and fills) required to draw the image at runtime rather than the raw graphic data. However, converting the vector data to the final image is time consuming and must be done whenever there is a change in appearance or position of a graphic. If your image contains complex shape outlines or large fill areas, and they also change every frame, your animations might run slowly.

In this chapter, we explore several ways of reducing the performance hit caused by using vectors, including how to design graphics [Hack #68] and when to substitute bitmaps for vector images [Hack #72] .