6.4. Animating Bitmaps
Problem
You want to animate a bitmap graphic.
Solution
Use frame-by-frame animation; or encapsulate the bitmap in a symbol, and apply a motion tween or use ActionScript to animate the symbol.
Discussion
If you want to animate a bitmap, you can use frame-by-frame animation, motion tweens, or scripted animation. The only type of animation you cannot use with bitmaps is the shape tween (though you can shape-tween the rectangular box bounding the bitmap). Each of these types of animation works as described in Chapter 4. The only difference is that to apply a motion tween to a bitmap or animate it using ActionScript, you must first enclose it within a symbol, such as a graphic symbol (motion tweens only) or a movie clip symbol.
To improve the quality of bitmap animations, you might experiment with the following:
Break apart the bitmap by choosing Modify → Break Apart. Use this technique even if the bitmap is enclosed within a graphic or movie clip symbol.
Disallow smoothing. To do so, select a bitmap in the library, and click the Properties button at the bottom of the library. In the Bitmap Properties dialog box, uncheck Allow Smoothing.
Change the bitmap’s compression to Lossless (PNG/GIF). Though this option may increase the file size of the movie, it is often the JPEG compression that is to blame for banded and flickering bitmap animations, especially when the bitmap is scaled in an animation, such as zooming in or out. The Compression setting can also be found in the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access