About Bitmap Caching, Scrolling, And Performance - MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

The first section of code in this code example defines two variables:
. The
speed
direction
right (
) or right to left (
1
time the
onEnterFrame
move more quickly, although the animation appears a bit less smooth.
The next section of code creates two empty movie clips:
by 100 pixel rectangle is drawn inside the
Next, a new object (
MovieClipLoader instance created in the final block of code. This object defines an event
listener for the
onLoadInit
scrolling animation. After the image reaches the left or right edge of the mask, the
animation reverses.
The final block of code defines a MovieClipLoader instance, specifies the listener object
you created earlier, and begins loading the JPEG image into the
4.
Select Control > Test Movie to test the document.
The image loads and then animates back and forth in a panning motion (side to side
motion). The image is masked at runtime. To see the original image, you can view it
online (
http://www.helpexamples.com/flash/images/image1.jpg
About bitmap caching, scrolling, and
performance
Flash Player 8 introduces bitmap caching, which helps you enhance the performance of
nonchanging movie clips in your applications. When you set the
MovieClip.cacheAsBitmap
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.
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.
480
Animation, Filters, and Drawings
variable controls whether the masked image scrolls from left to
). The
variable controls how many pixels are moved each
-1
speed
event handler is called. Larger numbers cause the animation to
) is created, which you use as a listener for a
mcl_obj
event, masks the dynamically loaded image, and sets up the
or
Button.cacheAsBitmap
img_mc
movie clip using the Drawing API.
mark_mc
property to
and
direction
and
. A 300 pixel
mask_mc
movie clip.
img_mc
).
, Flash Player
true

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?

This manual is also suitable for:

Flash 8

Table of Contents