EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Page 375

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
About caching and scrolling movie clips with ActionScript 375
For examples of scrolling movie clips, see scrollRect (MovieClip.scrollRect
property)
in the ActionScript 2.0 Language Reference. For information on alpha channel
masking, which requires you to set the
cacheAsBitmap property to true, see “About alpha
channel masking” on page 377.
You can find a sample source file that shows you how bitmap caching can be applied to an
instance. Find the file called cacheBitmap.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\CacheBitmap.
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.
Setting the background of a movie clip
You can set an opaque background for a movie clip. For example, when you have a
background that contains complex vector art, you can set the
opaqueBackground property to
a specified color (typically the same color as the Stage). The background is then treated as a
bitmap, which helps optimize performance.
When you set
cacheAsBitmap to true, and also set the opaqueBackground property to a
specified color, the opaqueBackground property allows the internal bitmap to be opaque and
rendered faster. If you do not set
cacheAsBitmap to true, the opaqueBackground property
adds an opaque vector-square shape to the background of the movie clip instance. It does not
create a bitmap automatically.
The following example shows how to set the background of a movie clip to optimize
performance.
To set the background of a movie clip:
1. Create a new Flash document called background.fla.
2. Draw a blue circle on the Stage.
3. Select the blue circle, and then select Modify > Convert to Symbol.
4. Select the Movie clip option, and then click OK.

Table of Contents

Related product manuals