MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 373

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

Use surfaces for movie clip instances that are largely static (nonanimating). You can drag
or move the instance, but the contents of the instance should not animate or change a lot.
For example, if you rotate or transform an instance, the instance changes between the
surface and vector data, which is difficult to process and negatively affects your SWF file.
If you mix surfaces with vector data, it increases the amount of processing that Flash
Player (and sometimes the computer) needs to do. Group surfaces together as much as
possible; for example, when you create windowing applications.
Caching a movie clip
To cache a movie clip instance, you need to set the
you set the
cacheAsBitmap
automatically pixel-snaps to whole coordinates. When you test the SWF file, you should
notice that any complex vector animation renders much faster.
A surface (cached bitmap) is not created, even if
of the following occurs:
The bitmap is greater than 2880 pixels in height or width.
The bitmap fails to allocate (out of memory error).
To cache a movie clip:
1.
Create a new Flash document, and name the file cachebitmap.fla.
2.
Type 24 into the fps text box in the Property inspector (Window > Properties > Properties).
3.
Create or import a complex vector graphic into the FLA file.
You can find a complex vector graphic in the finished source file for this example in the
following directory:
In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript\CacheBitmap.
On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/
Samples and Tutorials/Samples/ActionScript/CacheBitmap.
4.
Select the vector graphic, and select Modify > Convert to Symbol.
5.
Type star into the Name text box, and then click Advanced (if the dialog box is not already
expanded).
6.
Select Export for ActionScript (which also selects Export in first frame).
7.
Type star_id into the Identifier text box.
8.
Click OK to create the movie clip symbol, with the linkage identifier of Star.
property to
, you might notice that the movie clip instance
true
cacheAsBitmap
About caching and scrolling movie clips with ActionScript
property to
cacheAsBitmap
is set to
. After
true
, if one or more
true
373

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents