About bitmap caching, scrolling, and performance

Flash includes bitmap caching, which helps you enhance the performance of nonchanging movie clips in your applications. When you set the MovieClip.cacheAsBitmap or Button.cacheAsBitmap property to true, Flash Player caches an internal bitmap representation of the movie clip or button instance. This can improve performance for movie clips that contain complex vector content. All of the vector data for a movie clip that has a cached bitmap is drawn to the bitmap, instead of to the main Stage.

NOTE

 

The bitmap is copied to the main Stage as unstretched, unrotated pixels snapped to the nearest pixel boundaries. Pixels are mapped one-to-one with the parent object. If the bounds of the bitmap change, the bitmap is re-created instead of being stretched.

For detailed information on caching button or movie clip instances see the following sections in Working with Movie Clips:

It's ideal to use the cacheAsBitmap property with movie clips that have mostly static content and that do not scale and rotate frequently. With such movie clips, using the cacheAsBitmap property can lead to performance improvements when the movie clip is translated (when its x and y position is changed). For detailed information about when to use this feature, see When to enable caching.

For samples of how bitmap caching can be applied to an instance and how to apply bitmap caching to scrolling text, see the Flash Samples page at www.adobe.com/go/learn_fl_samples. The following samples are available:


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00000959.html