View comments | RSS feed
Packagefl.transitions
Classpublic class TransitionManager
InheritanceTransitionManager Inheritance EventDispatcher Inheritance Object

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

The TransitionManager class defines animation effects. It allows you to apply one of ten animation effects to movie clips. When creating custom components, you can use the TransitionManager class to apply animation effects to movie clips in your component's visual interface. The transition effects in fl.transitions.easing are defined as a set of transition classes that all extend the base class fl.transitions.Transition. You apply transitions through an instance of a TransitionManager only; you do not instantiate them directly. The TransitionManager class implements animation events.

You can create a TransitionManager instance in two ways:

See also

TransitionManager.start()
TransitionManager constructor function
TransitionManager.startTransition()
fl.transitions.Tween
fl.transitions.easing


Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  content : MovieClip
The movie clip instance to which TransitionManager is to apply a transition.
TransitionManager
  contentAppearance : Object
[read-only] An object that contains the saved visual properties of the content (target movie clip) to which the transitions will be applied.
TransitionManager
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
Constructor function for creating a new TransitionManager instance.
TransitionManager
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
start(content:MovieClip, transParams:Object):Transition
[static] Creates a new TransitionManager instance, designates the target object, applies a transition, and starts the transition.
TransitionManager
  
Creates a transition instance and starts it.
TransitionManager
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 InheritedDispatched when Flash Player or an AIR application gains operating system focus and becomes active.EventDispatcher
 InheritedDispatched when Flash Player or an AIR application loses operating system focus and is becoming inactive.EventDispatcher
Property Detail
contentproperty
content:MovieClip  [read-write]

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

The movie clip instance to which TransitionManager is to apply a transition.


Implementation
    public function get content():MovieClip
    public function set content(value:MovieClip):void
contentAppearanceproperty 
contentAppearance:Object  [read-only]

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

An object that contains the saved visual properties of the content (target movie clip) to which the transitions will be applied.


Implementation
    public function get contentAppearance():Object
Constructor Detail
TransitionManager()Constructor
public function TransitionManager(content:MovieClip)

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

Constructor function for creating a new TransitionManager instance. However, the TransitionManager.start() method is a more efficient way of creating and implementing a TransitionManager instance. If you do use the TransitionManager constructor function to create an instance, use the new operator then designate the transition properties and start the transition effect in a second step by calling the TransitionManager.startTransition() method.

For example:

import fl.transitions.*; import fl.transitions.easing.*; var myTransitionManager:TransitionManager = new TransitionManager(myMovieClip); myTransitionManager.startTransition({type:Zoom, direction:Transition.IN, duration:1, easing:Bounce.easeOut});

Parameters
content:MovieClip — The MovieClip object to which to apply the transition effect.

See also

Method Detail
start()method
public static function start(content:MovieClip, transParams:Object):Transition

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

Creates a new TransitionManager instance, designates the target object, applies a transition, and starts the transition. Specifically, calling this method creates an instance of the TransitionManager class if one does not already exist, creates an instance of the specified transition class designated in the transParams parameter, and then starts the transition. The transition is applied to the movie clip that is designated in the content parameter.

For example:

  import fl.transitions.*;
  import fl.transitions.easing.*;
    
  TransitionManager.start(myMovieClip, {type:Zoom, direction:Transition.IN, duration:1, easing:Bounce.easeOut});
  

Parameters

content:MovieClip — The MovieClip object to which to apply the transition effect.
 
transParams:Object — 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 be applied, followed by direction, duration, and easing parameters. In addition, you must include any parameters required by that transition effect class. For example, the fl.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 fl.transitions.Iris effect requires.

Returns
Transition — The Transition instance.
startTransition()method 
public function startTransition(transParams:Object):Transition

Language Version : ActionScript 3.0
Runtime Versions : AIR 1.0, Flash Player 9

Creates a transition instance and starts it. If a matching transition already exists, the existing transition is removed and a new transition is created and started. This method is used in conjunction with the constructor function.

For example:

  import fl.transitions.*;
  import fl.transitions.easing.*;
        
  var myTransitionManager:TransitionManager = new TransitionManager(myMovieClip);
  myTransitionManager.startTransition({type:Zoom, direction:Transition.IN, duration:1, easing:Bounce.easeOut});
  

Alternatively, you can use the TransitionManager.start() method, which is a more efficient way of implementing a transition effect.

Parameters

transParams:Object — 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 be applied, followed by direction, duration, and easing parameters. In addition, you must include any parameters required by that transition effect class. For example, the fl.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 fl.transitions.Iris effect requires.

Returns
Transition — The Transition instance.

See also





 


Comments


No screen name said on Jul 7, 2007 at 5:55 PM :
The TransitionManager class in ActionScript 2 has Events that are useful to determine when a transition has completed. These events are not documented for AS3, but still seem to exist.

For example, if I have a MovieClip called "box6_mc" on the stage, then add the following as a framescript...

import flash.filters.DropShadowFilter;
var tm:TransitionManager = new TransitionManager(box6_mc);
tm.startTransition({type:Wipe, direction:Transition.IN, duration:0.5, easing:None.easeNone, startPoint:4});
//var lsnr:Object = new Object();
//attach the drop shadow after the transition is completed
function lsnr(e:Event):void {
trace(e.currentTarget.content);//e.target = transitionManager//e.target.content = the object (not instance)being transitioned
box6_mc.textbox_mc.filters = [new DropShadowFilter(3, 45, 0x2F5E8C, 0.5, 4, 4, 1, 1, false, false, false)];
trace("wipe transition complete");
};
tm.addEventListener("allTransitionsInDone", lsnr);

the event "allTransitionsInDone" seems to be dispatched when the transition has completed. So is this an undocumented feature? Will there be documented events in future?
Thanks,
Laurie Jensen
No screen name said on Aug 7, 2007 at 7:58 AM :
"allTransitionsInDone" still needs documenting. This is an important feature
No screen name said on Aug 18, 2007 at 3:22 PM :
If you open the file TrantisionManager.as and look for dispatchEvent call you
can find two events, allTransitionsOutDone and allTransitionsInDone.

What I don't get is how is it possible that Adobe didn't document this two
small things.
ElelphentTrunk said on Oct 7, 2007 at 11:39 PM :
it says it in the notes of TrantisionManager.as why the events are not documented:

// Fix bug 58135
// Don't send allTransitionsOutDone if content was
// hidden before the transitions actually finished.

but, like the others say, it works. yay for livedocs.
both
Rodislav said on Feb 22, 2008 at 4:37 AM :
in transition can be used --> start() method, but something like --> stop() or it is possible to do something like that ?
No screen name said on Mar 31, 2008 at 7:08 AM :
The start method seems to fail if the content parameter is not a instance of a
dynamic class.
A __transitionManager property is required on the class, and the transition
doesn't work if this parameter doesn't exists (unless the class is declared as
dynamic). Any documention about __transitionManager property ?
Joe ... Ward said on Apr 4, 2008 at 3:35 PM :
Yes, since the TransitionManager adds properties to the target MovieClip object, if you extend MovieClip, you must also make the extended class dynamic in order to use the TransitionManager.
(The __transitionManager property is not documented because it is an implementation detail that could change in future versions of the Flash Player.)
silent_bob1984 said on May 11, 2008 at 6:11 PM :
I am trying to use

var tm = new TransitionManager(img1_mc)
tm.startTransition({type:Blinds, direction:0, duration:1, easing:None.easeNone, numStrips:3, dimension:1});

The transition runs, but when its complete, img1_mc reapears.

If i use

TransitionManager.start(img1_mc, {type:Blinds, direction:direc, duration:dur, easing:ease, numStrips:strip, dimension:dim});

it works fine, but then I cant find a way of listening for the AllTransitionsOutComplete event.

Anybody any ideas?
awirick said on Jul 15, 2008 at 12:37 PM :
for silent_bob1984

The way around it is less than intuitive but pretty easy. You can add an event listener to the hidden transitionManager instance by using:

img1_mc.__transitionManager.addEventListener("allTransitionsOutDone", eventHandler);

or whatever MovieClip you passed the TransitionManager.start function.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/transitions/TransitionManager.html