Packageorg.goasap.utils
Classpublic class SequenceCA
InheritanceSequenceCA Inheritance SequenceBase Inheritance PlayableBase Inheritance flash.events.EventDispatcher

Sequence with "Custom Advance" options, in which steps can specify when they should advance.

This class works like Sequence but uses the special class SequenceStepCA for its steps. SequenceStepCA has a property called advance. When steps advance before animation finishes, the trailing steps are tracked so that the SequenceCA doesn't dispatch its COMPLETE event until all activity has completed.

Any step's advance property can be set to an instance of OnDurationComplete, OnPlayableComplete, OnEventComplete or OnConditionTrue. Each of those classes defines its own parameters and rules for when the advance occurs. For example, using OnPlayableComplete a sequence can advance after one particular item in the step finishes, without needing to wait for all the other ones in that group to complete.

Additionally, you can create your own custom advance types by subclassing the SequenceAdvance base class.

See also

SequenceStepCA
OnConditionTrue
OnDurationComplete
OnEventComplete
OnPlayableComplete
SequenceAdvance
Sequence
SequenceBase


Public Properties
 PropertyDefined by
  currentStep : SequenceStepCA
[read-only] Returns the currently-playing SequenceStepCA.
SequenceCA
  lastStep : SequenceStepCA
[read-only] Returns the final SequenceStepCA in the current sequence.
SequenceCA
 Inheritedlength : int
The number of steps in the sequence.
SequenceBase
 InheritedplayableID : *
An arbitrary id value for the convenient identification of any instance, automatically set to an instance count by this class.
PlayableBase
 InheritedplayIndex : int
The current play index of the sequence, starting a 0.
SequenceBase
 Inheritedrepeater : Repeater
The sequence's Repeater instance, which may be used to make the sequence loop and play more than one time.
SequenceBase
 Inheritedstate : String
Returns a PlayStates constant.
PlayableBase
 Inheritedsteps : Array
Get or set the list of SequenceStep instances that defines the sequence.
SequenceBase
Protected Properties
 PropertyDefined by
 Inherited_playRetainer : Dictionary
[static] Memory-management: playable items that do not add themselves to GoEngine should use this property to store references to themselves during play.
PlayableBase
Public Methods
 MethodDefined by
  
SequenceCA(... items)
Constructor.
SequenceCA
  
addStep(item:IPlayable, addToLastStep:Boolean = false):int
Adds a single IPlayable instance (e.g.
SequenceCA
  
addStepAt(item:IPlayable, index:int):int
Adds a single IPlayable instance (e.g.
SequenceCA
  
Retrieves any SequenceStepCA from the steps array.
SequenceCA
  
getStepByID(playableID:*):SequenceStepCA
Locates a step with the specified playableID.
SequenceCA
  
pause():Boolean
Pauses sequence play.
SequenceCA
  
Removes and returns the SequenceStepCA at a specific index from the steps array.
SequenceCA
  
resume():Boolean
Resumes previously-paused sequence play.
SequenceCA
  
skipTo(index:Number):Boolean
Stops current activity and skips to another step by sequence index.
SequenceCA
  
start():Boolean
Begins a sequence.
SequenceCA
  
stop():Boolean
Stops all activity and dispatches a GoEvent.STOP event.
SequenceCA
 Inherited
toString():String
Appends the regular toString value with the instance's playableID.
PlayableBase
Protected Methods
 MethodDefined by
 Inherited
_addStep(item:IPlayable, addToLastStep:Boolean = false, stepTypeAsClass:* = null):int
Developers: Add a method called addStep to your subclass as in Sequence.
SequenceBase
 Inherited
_addStepAt(index:int, item:IPlayable, stepTypeAsClass:* = null):int
Developers: Add a method called addStep to your subclass as in Sequence.
SequenceBase
 Inherited
Developers: Add a getter called currentStep to your subclass as in Sequence.
SequenceBase
 Inherited
Developers: Add a getter called lastStep to your subclass as in Sequence.
SequenceBase
 Inherited
_getStepAt(index:int):*
Developers: Add a method called getStepAt to your subclass as in Sequence.
SequenceBase
 Inherited
_getStepByID(playableID:*):*
Developers: Add a method called getStepByID to your subclass as in Sequence.
SequenceBase
 Inherited
_removeStepAt(index:int):*
Developers: Add a method called addStep to your subclass as in Sequence.
SequenceBase
Events
 EventSummaryDefined by
 Inherited Dispatched when the sequence advances to its next step.SequenceBase
 Inherited Dispatched when the sequence successfully finishes.SequenceBase
 Inherited Dispatched at the end the group if repeater.cycles is set to a value other than one, just before the sequence starts its next play cycle.SequenceBase
 Inherited Dispatched when the sequence is paused successfully.SequenceBase
 Inherited Dispatched when the sequence is resumed successfully.SequenceBase
 Inherited Dispatched when the sequence starts.SequenceBase
 Inherited Dispatched when the sequence is manually stopped, which may also occur if one of its step instances is manually stopped outside the sequence.SequenceBase
Property detail
currentStepproperty
currentStep:SequenceStepCA  [read-only]

Returns the currently-playing SequenceStepCA.

Implementation
    public function get currentStep():SequenceStepCA

See also

lastStepproperty 
lastStep:SequenceStepCA  [read-only]

Returns the final SequenceStepCA in the current sequence.

Implementation
    public function get lastStep():SequenceStepCA

See also

Constructor detail
SequenceCA()constructor
public function SequenceCA(... items)

Constructor.

Parameters
... items — Any number of IPlayable instances (e.g. LinearGo, PlayableGroup, SequenceStepCA) as separate arguments, or a single array of them.
Method detail
addStep()method
public function addStep(item:IPlayable, addToLastStep:Boolean = false):int

Adds a single IPlayable instance (e.g. LinearGo, PlayableGroup, SequenceStepCA) to the end of the steps array, or optionally adds the instance into the last SequenceStepCA instead of adding it as a new step.

To remove a step use the removeStepAt method.

Parameters
item:IPlayable — The playable item to add to the sequence. Note that when new steps are added, any IPlayable instance of a type other than SequenceStepCA is automatically wrapped in a new SequenceStepCA.
 
addToLastStep:Boolean (default = false) — If true is passed the item is added to the last existing SequenceStepCA in the steps array. This option should be used with individual items that you want added as children to the SequenceStepCA. If there are no steps yet this option ignored and a new step is created.

Returns
int — New length of the steps array.
addStepAt()method 
public function addStepAt(item:IPlayable, index:int):int

Adds a single IPlayable instance (e.g. LinearGo, PlayableGroup, SequenceStepCA) at a specific index in the steps array. Calling this method stops any sequence play currently in progress.

Parameters
item:IPlayable — The playable item to splice into the sequence.
 
index:int — Position in the array starting at 0, or a negative index like Array.splice.

Returns
int — New length of the steps array.
getStepAt()method 
public function getStepAt(index:int):SequenceStepCA

Retrieves any SequenceStepCA from the steps array.

Parameters
index:int — An array index starting at 0.

Returns
SequenceStepCA — The SequenceStepCA instance at this index.

See also

getStepByID()method 
public function getStepByID(playableID:*):SequenceStepCA

Locates a step with the specified playableID. To search within a step for a child by playableID, use the step instance's getChildByID method.

Parameters
playableID:* — The step instance's playableID to search for.

Returns
SequenceStepCA — The SequenceStepCA with the matching playableID.
pause()method 
public override function pause():Boolean

Pauses sequence play.

Returns
Boolean — Returns true unless sequence was unable to pause any children.
removeStepAt()method 
public function removeStepAt(index:int):SequenceStepCA

Removes and returns the SequenceStepCA at a specific index from the steps array. Calling this method stops any sequence play currently in progress.

Parameters
index:int — Position in the array starting at 0, or a negative index like Array.splice.

Returns
SequenceStepCA — The SequenceStepCA instance removed from the steps array.
resume()method 
public override function resume():Boolean

Resumes previously-paused sequence play.

Returns
Boolean — Returns true unless sequence was unable to resume any children.
skipTo()method 
public override function skipTo(index:Number):Boolean

Stops current activity and skips to another step by sequence index.

Parameters
index:Number

Returns
Boolean — Always returns true since the index is normalized to the sequence.
start()method 
public override function start():Boolean

Begins a sequence.

If the group is active when this method is called, a stop call is automated which will result in a GoEvent.STOP event being dispatched.

Returns
Boolean — Returns true unless there are no steps in the sequence.
stop()method 
public override function stop():Boolean

Stops all activity and dispatches a GoEvent.STOP event.

Returns
Boolean — Returns true unless sequence was already stopped.