Packageflare.animate
Classpublic class FunctionSequence
InheritanceFunctionSequence Inheritance Sequence Inheritance Transition Inheritance flash.events.EventDispatcher

Transition that runs sub-transitions in sequential order while also invoking a function before each sub-transition is run. Each function must take a Transition instance (often a Transitioner) as input. Function sequences can only be played forwards; any attempt to play one in reverse will result in an error.

Function sequences are useful for ensuring a particular function is run before a sub-transition begins. For example, the function may populate the values of a Transitioner on the fly, or may be used to control other variables or side-effects that affect the subsequent sub-transition(s).



Public Properties
 PropertyDefined by
 InheritedautoDuration : Boolean
If true, the duration of this sequence is automatically determined by the durations of each sub-transition.
Sequence
 InheritedDEFAULT_EASING : Function
[static] Default easing function: a cubic slow-in slow-out.
Transition
 Inheriteddelay : Number
The delay between a call to play and the actual start of the transition, in seconds.
Transition
 Inheritedduration : Number
The duration (length) of this Transition, in seconds.
Sequence
 Inheritedeasing : Function
Easing function used to pace this Transition.
Transition
 Inheritedenabled : Boolean = true
Flag indicating if step events should be processed.
Transition
 Inheritedid : String
A unique name identifying this schedulable object.
Transition
  offsetStartTime : Boolean
Flag indicating if extra time should be added to the transition to offset the running time of invoked functions.
FunctionSequence
 Inheritedprogress : Number
Fraction between 0 and 1 indicating the current progress of this transition.
Transition
 Inheritedreverse : Boolean
Indicates if this Transition is running in reverse.
Transition
 Inheritedrunning : Boolean
Indicates if this Transition is currently running.
Transition
 InheritedtotalDuration : Number
The total duration, including both delay and active duration.
Transition
Protected Properties
 PropertyDefined by
 Inherited_reverse : Boolean = false
Flag indicating this Transition is running in reverse.
Transition
 Inherited_running : Boolean = false
Flag indicating this Transition is currently running.
Transition
 Inherited_trans : Array
Array of sequential transitions
Sequence
Public Methods
 MethodDefined by
  
Creates a new FunctionSequence transition.
FunctionSequence
  
add(t:Transition):void
Adds a new transition to the end of this sequence.
FunctionSequence
 Inherited
cancelled():void
Informs this transition that it was cancelled by the scheduler.
Transition
  
dispose():void
Disposes of this transition, freeing up any resources held.
FunctionSequence
 Inherited
evaluate(time:Number):Boolean
Evaluates the Transition, stepping the transition forward.
Transition
 Inherited
pause():void
Pauses the transition at its current position.
Transition
  
play(reverse:Boolean = false):void
Plays this function sequence.
FunctionSequence
  
push(f:Function, t:*):void
Adds a function call and corresponding transition to this sequence.
FunctionSequence
  
remove(t:Transition):Boolean
Removes a sub-transition from this sequence.
FunctionSequence
  
removeFunction(f:Function):Boolean
Removes a sub-transition function from this sequence.
FunctionSequence
 Inherited
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
Steps this sequence transition, ensuring that any sub-transitions between the previous and current progress fraction are properly invoked.
FunctionSequence
 Inherited
stop():void
Stops the transition and completes it.
Transition
Protected Methods
 MethodDefined by
 Inherited
Computes the duration of this sequence transition.
Sequence
 Inherited
end():void
Ends this sequence transition, ending the last transition to be played in the sequence as necessary.
Sequence
  
setup():void
Sets up each sub-transition.
FunctionSequence
  
start():void
Starts this sequence transition, starting the first sub-transition to be played.
FunctionSequence
Events
 EventSummaryDefined by
 Inherited  Transition
 Inherited
end
 Transition
 Inherited  Transition
 Inherited  Transition
Protected Constants
 ConstantDefined by
 InheritedINIT : int = 1
[static] Constant indicating this Transition has been initialized.
Transition
 InheritedRUN : int = 2
[static] Constant indicating this Transition is currently running.
Transition
 InheritedSETUP : int = 0
[static] Constant indicating this Transition needs initialization.
Transition
Property detail
offsetStartTimeproperty
offsetStartTime:Boolean  [read-write]

Flag indicating if extra time should be added to the transition to offset the running time of invoked functions. True by default.

Implementation
    public function get offsetStartTime():Boolean
    public function set offsetStartTime(value:Boolean):void
Constructor detail
FunctionSequence()constructor
public function FunctionSequence()

Creates a new FunctionSequence transition.

Method detail
add()method
public override function add(t:Transition):void

Adds a new transition to the end of this sequence.

Parameters
t:Transition — the transition to add
dispose()method 
public override 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.

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

Plays this function sequence. Function sequences can not be played in reverse.

Parameters
reverse:Boolean (default = false) — If true, an error will be thrown and the sequence will not play.
push()method 
public function push(f:Function, t:*):void

Adds a function call and corresponding transition to this sequence. As the sequence plays, functions will be called at the beginning of their subsequence, with the provided transition passed as the function's sole argument.

Parameters
f:Function — a function to call at the beginning of a sub-sequence
 
t:* — the transition to run after the function call. This transition will be passed in as an input to the function. This value should be either a Transition instance or a number indicating the duration for a new Transitioner.
remove()method 
public override function remove(t:Transition):Boolean

Removes a sub-transition from this sequence. Any corresponding function will also be removed.

Parameters
t:Transition — the transition to remove

Returns
Boolean — true if the transition was found and removed, false otherwise
removeFunction()method 
public function removeFunction(f:Function):Boolean

Removes a sub-transition function from this sequence. The corresponding transition instance will also be removed.

Parameters
f:Function — the transition to remove

Returns
Boolean — true if the transition was found and removed, false otherwise
setup()method 
protected override function setup():void

Sets up each sub-transition.

start()method 
protected override function start():void

Starts this sequence transition, starting the first sub-transition to be played.

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

Steps this sequence transition, ensuring that any sub-transitions between the previous and current progress fraction are properly invoked.

Parameters
ef:Number — the current progress fraction.