ActionScript 2.0 Components Language Reference |
|
|
|
| TransitionManager class > TransitionManager.startTransition() | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
transitionManagerInstance.startTransition(transParams)
transParams A collection of parameters that are passed within an object.
The transParams object should contain a type parameter that indicates the transition effect class to apply, followed by direction, duration, and easing parameters. In addition, you must include any parameters required by the specified transition effect class. For example, the mx.transitions.Iris transition effect class requires additional startPoint and shape parameters. So, in addition to the type, duration, and easing parameters that every transition requires, you would also add (to the transParams object) the startPoint and shape parameters that the mx.transitions.Iris effect requires. The following code adds startPoint and shape parameters to the mx.transitions.Iris effect:
{type:mx.transitions.Iris, direction:mx.transitions.Transition.IN, duration:5, easing:mx.transitions.easing.Bounce.easeOut, startPoint:5, shape:mx.transitions.Iris.CIRCLE}
To verify the additional parameters required for the transition class effect that you are specifying in the transParam object's type parameter, see the API for that transition class. For example, for more information about the Blinds transition class, see Blinds transition.
|
NOTE |
The |
import mx.transitions.*; import mx.transitions.easing.*;
An instance of the Transition object that the TransitionManager instance is assigned to apply.
Method; creates and starts an instance of the specified transition class, which is applied to the slide or movie clip that the TransitionManager instance is assigned to affect. If a matching transition already exists, that transition is removed and a new transition is created and started.
The following code imports the TransitionManager class and creates a new TransitionManager instance. Next, the TransitionManager.startTransition() method designates a mx.transitions.Zoom transition in its type parameter. The direction parameter indicates that the transition should move in the out direction by designating mx.transitions.Transition.OUT. The duration of the transition is 3 seconds. The easing is calculated by using the mx.transitions.Bounce.easeOut() method of the Bounce class. This effect causes the img1_mc movie clip to appear to zoom out in a bouncing motion until it disappears, with the entire effect lasting 3 seconds.
import mx.transitions.*;
import mx.transitions.easing.*;
var myTransitionManager:TransitionManager = new TransitionManager(img1_mc);
myTransitionManager.startTransition({type:Zoom, direction:Transition.OUT, duration:3, easing:Bounce.easeOut});
|
|
|
|