478
Animation, Filters, and Drawings
For information on using an
onEnterFrame
event handler or
setInterval()
function to
animate the image, see
“Fading objects with code” on page 472
.
For an example of scripted animation in Flash, you can find a sample source file,
animation.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\Animation.
■
On the Macintosh, browse to
Macintosh HD
/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/Animation.
You can also find samples of photo gallery applications on your hard disk.These files provide
examples of how to use ActionScript to control movie clips dynamically while loading image
files into a SWF file, which includes scripted animation. You can find the sample source files,
gallery_tree.fla and gallery_tween.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\Galleries.
■
On the Macintosh, browse to
Macintosh HD
/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/Galleries.
Panning an image with code
Using ActionScript, you can easily pan large images within your Flash documents. This is
useful when your image doesn’t fit on the Stage, or you want to create an animation effect in
which you pan a movie clip from one side of the Stage to the other. For example, if you have a
large panoramic image that is larger than your Stage size, but you don’t want to reduce the
dimensions of your image or increase the dimensions of your Stage, you can create a movie
clip that acts as a mask for the larger image.
The following procedure demonstrates how you can dynamically mask a movie clip and use
an
onEnterFrame
event handler to animate an image behind the mask.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...