Scripting animation with ActionScript 2.0
You can use ActionScript 2.0 to add animation to your Flash applications, instead of using
motion or shape tweens on a timeline.The following sections show you how to use code to
animate instances, such as changing the transparency and appearance of the instance, and
moving the instance around the Stage.
For information on using the Tween and TransitionManager classes to further automate code-
based animations, see
on page
1273. These classes help you add advanced easing equations and transition
animations to movie clip instances in your application. Many of these effects are difficult to
recreate using ActionScript without these prebuilt classes, because the code you need to use
involves writing complex mathematical equations to achieve the effect.
For more information about how to animate drawings that you create with code, see
"Drawing with ActionScript" on page
The following sections describe how to script animations:
"About animation and frame rate" on page 471
"Fading objects with code" on page 472
"Adding color and brightness effects with code" on page 474
"Moving objects with code" on page 477
"Panning an image with code" on page 478
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 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.
470
Animation, Filters, and Drawings
"TransitionManager class" on page 1201
540.
and
"Tween class"
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?