| Package | org.goasap.utils |
| Class | public class SequenceCA |
| Inheritance | SequenceCA SequenceBase PlayableBase flash.events.EventDispatcher |
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
| Property | Defined by | ||
|---|---|---|---|
| currentStep : SequenceStepCA
[read-only]
Returns the currently-playing SequenceStepCA.
| SequenceCA | ||
| lastStep : SequenceStepCA
[read-only]
Returns the final SequenceStepCA in the current sequence.
| SequenceCA | ||
![]() | length : int
The number of steps in the sequence.
| SequenceBase | |
![]() | playableID : *
An arbitrary id value for the convenient identification of any
instance, automatically set to an instance count by this class.
| PlayableBase | |
![]() | playIndex : int
The current play index of the sequence, starting a 0.
| SequenceBase | |
![]() | repeater : Repeater
The sequence's Repeater instance, which may be used to make
the sequence loop and play more than one time.
| SequenceBase | |
![]() | state : String
Returns a PlayStates constant.
| PlayableBase | |
![]() | steps : Array
Get or set the list of SequenceStep instances that defines the sequence.
| SequenceBase | |
| Method | Defined by | ||
|---|---|---|---|
|
SequenceCA(... items)
Constructor.
| SequenceCA | ||
|
Adds a single IPlayable instance (e.g.
| SequenceCA | ||
|
Adds a single IPlayable instance (e.g.
| SequenceCA | ||
|
getStepAt(index:int):SequenceStepCA
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 | ||
|
removeStepAt(index:int):SequenceStepCA
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 | ||
![]() |
toString():String
Appends the regular toString value with the instance's playableID.
| PlayableBase | |
| currentStep | property |
currentStep:SequenceStepCA [read-only]Returns the currently-playing SequenceStepCA.
Implementation public function get currentStep():SequenceStepCA
See also
| lastStep | property |
lastStep:SequenceStepCA [read-only]Returns the final SequenceStepCA in the current sequence.
Implementation public function get lastStep():SequenceStepCA
See also
| 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.
|
| addStep | () | method |
public function addStep(item:IPlayable, addToLastStep:Boolean = false):intAdds 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.
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.
|
int — New length of the steps array.
|
| addStepAt | () | method |
public function addStepAt(item:IPlayable, index:int):intAdds 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.
Parametersitem: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.
|
int — New length of the steps array.
|
| getStepAt | () | method |
public function getStepAt(index:int):SequenceStepCARetrieves any SequenceStepCA from the steps array.
Parametersindex:int — An array index starting at 0.
|
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.
playableID:* — The step instance's playableID to search for.
|
SequenceStepCA —
The SequenceStepCA with the matching playableID.
|
| pause | () | method |
public override function pause():BooleanPauses sequence play.
ReturnsBoolean — Returns true unless sequence was unable to pause any children.
|
| removeStepAt | () | method |
public function removeStepAt(index:int):SequenceStepCARemoves and returns the SequenceStepCA at a specific index from the steps array. Calling this method stops any sequence play currently in progress.
Parametersindex:int — Position in the array starting at 0, or a negative
index like Array.splice.
|
SequenceStepCA —
The SequenceStepCA instance removed from the steps array.
|
| resume | () | method |
public override function resume():BooleanResumes previously-paused sequence play.
ReturnsBoolean — Returns true unless sequence was unable to resume any children.
|
| skipTo | () | method |
public override function skipTo(index:Number):BooleanStops current activity and skips to another step by sequence index.
Parametersindex:Number |
Boolean — Always returns true since the index is normalized to the sequence.
|
| start | () | method |
public override function start():BooleanBegins 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.
Boolean — Returns true unless there are no steps in the sequence.
|
| stop | () | method |
public override function stop():BooleanStops all activity and dispatches a GoEvent.STOP event.
ReturnsBoolean — Returns true unless sequence was already stopped.
|