Packageflare.animate
Classpublic class Transition
InheritanceTransition Inheritance flash.events.EventDispatcher
ImplementsISchedulable
SubclassesParallel, Pause, Sequence, Tween

Base class representing an animated transition. Provides support for tracking animation progress over a time duration. The Transition class also issues events whenever the transition is started, stepped, or ended. Register event listeners for TransitionEvents to track and respond to a transition's progress.

Useful subclasses of Transition include the Tween, Parallel, Sequence, Pause, and Transitioner classes.



Public Properties
 PropertyDefined by
  DEFAULT_EASING : Function
[static] Default easing function: a cubic slow-in slow-out.
Transition
  delay : Number
The delay between a call to play and the actual start of the transition, in seconds.
Transition
  duration : Number
The duration (length) of this Transition, in seconds.
Transition
  easing : Function
Easing function used to pace this Transition.
Transition
  enabled : Boolean = true
Flag indicating if step events should be processed.
Transition
  id : String
A unique name identifying this schedulable object.
Transition
  progress : Number
Fraction between 0 and 1 indicating the current progress of this transition.
Transition
  reverse : Boolean
[read-only] Indicates if this Transition is running in reverse.
Transition
  running : Boolean
[read-only] Indicates if this Transition is currently running.
Transition
  totalDuration : Number
[read-only] The total duration, including both delay and active duration.
Transition
Protected Properties
 PropertyDefined by
  _reverse : Boolean = false
Flag indicating this Transition is running in reverse.
Transition
  _running : Boolean = false
Flag indicating this Transition is currently running.
Transition
Public Methods
 MethodDefined by
  
Transition(duration:Number = 1, delay:Number = 0, easing:Function = null)
Creates a new Transition.
Transition
  
cancelled():void
Informs this transition that it was cancelled by the scheduler.
Transition
  
dispose():void
Disposes of this transition, freeing up any resources held.
Transition
  
evaluate(time:Number):Boolean
Evaluates the Transition, stepping the transition forward.
Transition
  
pause():void
Pauses the transition at its current position.
Transition
  
play(reverse:Boolean = false):void
Starts running the transition.
Transition
  
reset():void
Resets the transition, so that any cached starting values are cleared and reset the next time this transition is played.
Transition
  
step(ef:Number):void
Transition step routine.
Transition
  
stop():void
Stops the transition and completes it.
Transition
Protected Methods
 MethodDefined by
  
end():void
Transition end routine.
Transition
  
setup():void
Transition setup routine.
Transition
  
start():void
Transition start routine.
Transition
Events
 EventSummaryDefined by
    Transition
  
end
 Transition
    Transition
    Transition
Protected Constants
 ConstantDefined by
  INIT : int = 1
[static] Constant indicating this Transition has been initialized.
Transition
  RUN : int = 2
[static] Constant indicating this Transition is currently running.
Transition
  SETUP : int = 0
[static] Constant indicating this Transition needs initialization.
Transition
Property detail
DEFAULT_EASINGproperty
public static var DEFAULT_EASING:Function

Default easing function: a cubic slow-in slow-out.

delayproperty 
delay:Number  [read-write]

The delay between a call to play and the actual start of the transition, in seconds.

Implementation
    public function get delay():Number
    public function set delay(value:Number):void
durationproperty 
duration:Number  [read-write]

The duration (length) of this Transition, in seconds.

Implementation
    public function get duration():Number
    public function set duration(value:Number):void
easingproperty 
easing:Function  [read-write]

Easing function used to pace this Transition.

Implementation
    public function get easing():Function
    public function set easing(value:Function):void
enabledproperty 
public var enabled:Boolean = true

Flag indicating if step events should be processed.

idproperty 
id:String  [read-write]

A unique name identifying this schedulable object. The default is null. If non-null, any other scheduled items with the same id will be canceled upon scheduling.

Once an item has been scheduled, it's id should not be changed. However, it is left to subclasses to respect this convention. If it is not followed, erratic cancels may occur.

Implementation
    public function get id():String
    public function set id(value:String):void
progressproperty 
progress:Number  [read-write]

Fraction between 0 and 1 indicating the current progress of this transition.

Implementation
    public function get progress():Number
    public function set progress(value:Number):void
_reverseproperty 
protected var _reverse:Boolean = false

Flag indicating this Transition is running in reverse.

reverseproperty 
reverse:Boolean  [read-only]

Indicates if this Transition is running in reverse.

Implementation
    public function get reverse():Boolean
_runningproperty 
protected var _running:Boolean = false

Flag indicating this Transition is currently running.

runningproperty 
running:Boolean  [read-only]

Indicates if this Transition is currently running.

Implementation
    public function get running():Boolean
totalDurationproperty 
totalDuration:Number  [read-only]

The total duration, including both delay and active duration.

Implementation
    public function get totalDuration():Number
Constructor detail
Transition()constructor
public function Transition(duration:Number = 1, delay:Number = 0, easing:Function = null)

Creates a new Transition.

Parameters
duration:Number (default = 1) — the duration, in seconds
 
delay:Number (default = 0) — the delay, in seconds
 
easing:Function (default = null) — the easing function
Method detail
cancelled()method
public function cancelled():void

Informs this transition that it was cancelled by the scheduler. Assumes that the scheduler has already removed the transition. Clients should not call this method, but should use the stop() method to end a transition early.

dispose()method 
public function dispose():void

Disposes of this transition, freeing up any resources held. This method is optional, but calling it when a transition is no longer needed can help improve overall performance.

end()method 
protected function end():void

Transition end routine. Subclasses should override this function to perform custom ending actions.

evaluate()method 
public function evaluate(time:Number):Boolean

Evaluates the Transition, stepping the transition forward.

Parameters
time:Number — the current time in milliseconds

Returns
Boolean — true if this item should be removed from the scheduler, false if it should continue to be run.
pause()method 
public function pause():void

Pauses the transition at its current position. Calling play() after pause() will resume the transition.

play()method 
public function play(reverse:Boolean = false):void

Starts running the transition.

Parameters
reverse:Boolean (default = false) — if true, the transition is played in reverse, if false (the default), it is played normally.
reset()method 
public function reset():void

Resets the transition, so that any cached starting values are cleared and reset the next time this transition is played.

setup()method 
protected function setup():void

Transition setup routine. Subclasses should override this function to perform custom setup actions.

start()method 
protected function start():void

Transition start routine. Subclasses should override this function to perform custom start actions.

step()method 
public function step(ef:Number):void

Transition step routine. Subclasses should override this function to perform custom step actions.

Parameters
ef:Number
stop()method 
public function stop():void

Stops the transition and completes it. Any end-of-transition actions will still be taken. Calling play() after stop() will result in the transition starting over from the beginning.

Event detail
cancelevent 
Event object type: flare.animate.TransitionEvent

endevent  
Event object type: flare.animate.TransitionEvent

startevent  
Event object type: flare.animate.TransitionEvent

stepevent  
Event object type: flare.animate.TransitionEvent

Constant detail
INITconstant
protected static const INIT:int = 1

Constant indicating this Transition has been initialized.

RUNconstant 
protected static const RUN:int = 2

Constant indicating this Transition is currently running.

SETUPconstant 
protected static const SETUP:int = 0

Constant indicating this Transition needs initialization.