About the Tween and TransitionManager classes 497
The second section of ActionScript creates a listener object for the MovieClipLoader class
instance, which you create in the third section of code. When the target movie clip loads
into the MovieClipLoader instance, the
onLoadInit event triggers and executes the block
of code, which calls both the Tween class and the TransitionManager class. This event
handler fades in the target movie clip because you modify the
_alpha property in the
Tween class, and flies the target movie clip along the x-axis.
The third section of ActionScript code creates a MovieClipLoader instance and applies the
listener object that you created earlier (so the target movie clip loader instance can listen
for the
onLoadInit event). Then you load the target JPEG image into a movie clip that
you create dynamically by calling the
createEmptyMovieClip() method.
3. Save your document and select Control > Test Movie to view the animation in the
test environment.
After the external JPEG image finishes downloading from the server, the image fades in
gradually and animates from right to left across the Stage.
For information on using the Tween class, see “Using the Tween class” on page 490.
For information on each method and property of the Tween class, see Chapter 51, “Tween
class” in the Components Language Reference. For information on each method and property of
the TransitionManager class, see Chapter 48, “TransitionManager class” in the Components
Language Reference.
You can find a sample source file that adds scripted animation using these classes. Find
tweenProgress.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\Tween ProgressBar.
■ On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples
and Tutorials/Samples/ActionScript/Tween ProgressBar.