Optimization can be the difference between a professional looking Flash file and one that looks unpolished or animates sluggishly. The benefits go beyond merely reducing the file size of the final output (the .swf file). Optimized artwork also works much better with Flash's special effects such as transparency and shape tweening (morphing). In addition, the Flash player is able to animate optimized vector imagery much more efficiently due to the decreased amount of data it has to deal with in every frame.
The built-in Optimize feature of Flash is useful in some circumstances. But I'll show you a technique which is easier, more effective, and maintains the original image integrity more consistently.
Optimizing Using the Break Apart Feature
The easier and more effective method for optimizing vector artwork in Flash is simply to break the artwork apart until it can't be broken apart anymore, then regroup it.
To break apart the artwork, simply select your artwork and choose Modify > Break Apart (Mac: Cmd + B or Win: Ctrl + B). Clip art (and other vector artwork) is often created using multiple grouped objects (see Fig.1). So you might have to break apart the artwork more than once - until you see a screen pattern on each shape that comprises the artwork (see Fig. 2).
After breaking apart the artwork as much as possible, regroup it (Mac: Cmd + G or Win: Ctrl + G) and turn it into a symbol (Choose Insert > Convert to Symbol), unless you plan to use the shape morphing feature. When you break apart artwork in Flash and then regroup it, Flash throws out unnecessary data and reduces the file size.
Optimizing Using the Optimize Feature
If the first method does not provide enough file size saving or does not improve performance enough, you can try using the Optimize feature. To use the Optimize feature, first break apart the artwork.
Select Modify > Optimize to open the Optimize Curves dialog box (see Fig. 3). The Optimize feature works by smoothing lines and removing curves. The amount of data required by a vector image increases with every direction change in a line that defines a shape.
Experiment. The more curves you remove, the more the shape of the artwork is compromised. For some images this is fine, such as grass or leafy trees. For images such as character artwork, this can be very undesirable. Or you can intentionally use the Optimize feature to subtly or even aggressively change the look of a piece of clip art. See Fig. 4.
The Advantages of Optimizing Vector Imagery in Flash
One of the main advantages to optimizing images in Flash is the resultant file size savings. While the size reduction will vary from project to project, the difference can often be substantial. For example, we took four images from Image Club Business in Motion and created two versions of an animation (see Fig.5). The output file for the unoptimized version was almost 42 KB and the optimized version was just under 13 KB - that's over 65% file size reduction merely by breaking a few images apart!
Another advantage is improved performance. For instance, we created a simple dodge game using clip art from Image Club Neo Techno. Players must navigate a spaceship to avoid asteroids hurtling towards it. Flash is able to animate the spaceship and the multiple versions of the asteroids much more smoothly when the imagery has been optimized.
In many cases, optimized artwork looks and works better when effects are applied. For instance, clip art often contains multiple overlapping shapes. While this is good for isolating a section of clip art for a particular purpose, it's bad for alpha transparency effects in Flash. Without optimization, many clip art images with overlapping shapes look rough and unfinished when alpha transparency is applied. In addition, Flash has an even harder time animating an unoptimized image when effects like alpha transparency are applied to it. See Fig. 7.