MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 496

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

6.
Test the animation again (Control > Test Movie).
Now, the box stops easing before it goes off the boundaries of the Stage.
Combining the TransitionManager and
Tween classes
You can generate interesting effects when you combine the TransitionManager and Tween
classes. You can use the TransitionManager class to move a movie clip along the x-axis while
you adjust the same clip's
different easing method, which means you have many animation possibilities for objects in
your SWF files. You can take advantage of the
Tween class or the
onMotionFinished
You combine the TransitionManager and Tween classes to animate a dynamically loaded
movie clip and fade it in on the Stage after it fully loads from the remote server, as the
following procedure shows.
To use the TransitionManager and Tween classes together:
1.
Create a new Flash document and save the file as combination.fla.
2.
Add the following ActionScript on Frame 1 of the Timeline:
import mx.transitions.*;
import mx.transitions.easing.*;
var mcl_obj:Object = new Object();
mcl_obj.onLoadInit = function(target_mc:MovieClip) {
new Tween(target_mc, "_alpha", Strong.easeIn, 0, 100, 2, true);
TransitionManager.start(target_mc, {type:Fly,
direction:Transition.IN, duration:3, easing:Elastic.easeInOut,
startPoint:6});
};
var my_mcl:MovieClipLoader = new MovieClipLoader();
my_mcl.addListener(mcl_obj);
my_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg",
this.createEmptyMovieClip("img_mc", this.getNextHighestDepth()));
This code is separated into three main sections.
The first section of code imports the classes within the transitions package as well as the
transitions.easing
so you do not need to enter the fully qualified class name for the Tween class,
TransitionManager class, or the selected transition (in this case, Fly). This process can
reduce the amount of code you type and save you from potential typographical errors.
496
Animation, Filters, and Drawings
property using the Tween class. Each class can use a
_alpha
event handler to create a unique effect.
package. You import the entire transitions package in this example
and
continueTo()
yoyo()
methods in the

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents