About caching and scrolling movie clips with ActionScript
371
■
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/CacheBitmap.
You can also find a sample source file that shows you how to apply bitmap caching to scrolling
text. Find the sample source file, flashtype.fla, in the Samples folder on your hard disk.
■
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\FlashType.
■
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/FlashType.
When to enable caching
Enabling caching for a movie clip creates a surface, which has several advantages, such as
helping complex vector animations to render fast. There are several scenarios in which you
will want to enable caching. It might seem as though you will always want to enable caching
to improve the performance of your SWF files; however, there are situations in which
enabling caching does not improve performance, or even decrease it. This section describes
scenarios in which caching should be used, and when to use regular movie clips.
Overall performance of cached data depends on how complex the vector data of your
instances are, how much of the data you change, and whether or not you set the
opaqueBackground
property. If you are changing small regions, the difference between using
a surface and using vector data could be negligible. You might want to test both scenarios with
your work before you deploy the application.
For information on alpha channel masking, which requires you to set the
cacheAsBitmap
property to
true
, see
“About alpha channel masking” on page 377
.
When to use bitmap caching
The following are typical scenarios in which you might see significant benefits when you
enable bitmap caching.
Complex background image
An application that contains a detailed and complex
background image of vector data (perhaps an image where you applied the trace bitmap
command, or artwork that you created in Adobe Illustrator). You might animate characters
over the background, which slows the animation because the background needs to
continuously regenerate the vector data. To improve performance, you can select the content,
store it in a movie clip, and set the
opaqueBackground
property to
true
. The background is
rendered as a bitmap and can be redrawn quickly, so that your animation plays much faster.
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...