Packageimpression.players.sequencers
Classpublic class CommandSequencer
InheritanceCommandSequencer Inheritance BasePlayer Inheritance flash.events.EventDispatcher

The CommandSequencer class supports the playback of command sequencer storybords. A command sequencer storyboard includes a set of project-specific properties, and any number of child elements. Like all sequencer classes, the exact data and behavior is project-defined. The CommandSequencer class provides only the minimum functionality needed to perform custom actions.



Public Properties
 PropertyDefined By
 InheritedalwaysCheckComplete : Boolean
Specifies how the object should handle storyboard completion.
BasePlayer
  commandObjects : ChildElementCollection
[read-only] The command objects associated with the storyboard.
CommandSequencer
 InheritednarrationComplete : Boolean
Indicates whether narration has finished playing.
BasePlayer
  position : int
The position of the sequencer.
CommandSequencer
  status : String
[read-only] The current status of the sequencer.
CommandSequencer
  storyboard : Storyboard
[override] Specifies the storyboard for the player.
CommandSequencer
  useLastPosition : Boolean
Indicates whether or not the last position should be used when loading a previously loaded storyboard.
CommandSequencer
Public Methods
 MethodDefined By
  
Creates a new instance of the CommandSequencer.
CommandSequencer
 Inherited
Causes the player to examine the completion criteria for the current storyboard.
BasePlayer
  
[static] Creates a string describing the state of the storyboard.
CommandSequencer
  
[static] Removes all properties set by the player.
CommandSequencer
  
setStoryboardState(sb:Storyboard, state:String):void
[static] Modifies the storyboard to match the described state passed.
CommandSequencer
Protected Methods
 MethodDefined By
 Inherited
Initializes the storyboard.
BasePlayer
  
[override] Loads the storyboard.
CommandSequencer
  
[override] Removes known completion criteria from the CompleteRemaining storyboard persisted property.
CommandSequencer
  
[override] Performs cleanup actions when a storyboard is unloaded.
CommandSequencer
Events
 Event Summary Defined By
 InheritedDispatched when the BasePlayer needs to resolve completion criteria beyond those defined for the class.BasePlayer
 InheritedDispatched when a storyboard is marked as complete.BasePlayer
 InheritedDispatched after a storyboard is initialized.BasePlayer
 InheritedDispatched when storyboard loading is complete.BasePlayer
 InheritedDispatched when a storyboard is loaded, but before any processing occurs.BasePlayer
  Dispatched when the status of the sequencer changes.CommandSequencer
 InheritedDispatched before a storyboard is unloaded.BasePlayer
Property Detail
commandObjectsproperty
commandObjects:ChildElementCollection  [read-only]

The command objects associated with the storyboard.


Implementation
    public function get commandObjects():ChildElementCollection
positionproperty 
position:int

The position of the sequencer. In the CommandSequencer, this value indicates the index of the current command.

Setting this property value may cause the status property to be changed. Specifically, if position is set to a value < 0, the status property will be changed to SequencerStatusTypes.UNKNOWN. If position is set to a value >= the number of children, the status property will be changed to SequencerStatusTypes.EOF. For all other values, the status property will be changed to SequencerStatusTypes.STOPPED. If the storyboard property value is null, the status property will be changed to SequencerStatusTypes.NO_STORYBOARD.

If the storyboard property value is not null, setting this value will also set the storyboard's LastPosition persisted property value.


Implementation
    public function get position():int
    public function set position(value:int):void

See also

statusproperty 
status:String  [read-only]

The current status of the sequencer. This value will be one of the SequencerStatusTypes constant values.


Implementation
    public function get status():String

See also

storyboardproperty 
storyboard:Storyboard[override]

Specifies the storyboard for the player.

If null is passed, the current storyboard is unloaded, the StoryboardEvent.UNLOAD event is dispatched, and no further action occurs.

If a non- null storyboard object is passed, the following actions occur, in order:

  1. If the previously loaded storyboard is not null, the StoryboardEvent.UNLOAD event is dispatched. If the event is not cancelled, the current storyboard is unloaded. If the event is cancelled, further processing stops.
  2. The StoryboardEvent.LOAD_START event is dispatched. If the event is not cancelled, the new storyboard is associated with the player. If the event is cancelled, further processing stops and the value of this property is set to null.
  3. The StoryboardEvent.LOAD_COMPLETE event is dispatched.
  4. The checkForComplete() method is invoked. If all completion criteria have been met, the StoryboardEvent.COMPLETE event is dispatched.

Note that the CommandSequencer may raise one or move SequencerStatusEvent.STATUS_CHANGED events during storyboard load.


Implementation
    public function get storyboard():Storyboard
    public function set storyboard(value:Storyboard):void

See also

SequencerStatusTypes
BasePlayer.unload
BasePlayer.loadStart
BasePlayer.initialize
BasePlayer.loadComplete
BasePlayer.checkForComplete()
BasePlayer.complete
useLastPositionproperty 
useLastPosition:Boolean

Indicates whether or not the last position should be used when loading a previously loaded storyboard.

The default value is false.


Implementation
    public function get useLastPosition():Boolean
    public function set useLastPosition(value:Boolean):void
Constructor Detail
CommandSequencer()Constructor
public function CommandSequencer()

Creates a new instance of the CommandSequencer.

Method Detail
getStoryboardState()method
public static function getStoryboardState(sb:Storyboard):String

Creates a string describing the state of the storyboard.

This method returns a multiple-character string to describe the state of the storyboard. The size of the string will depend on the number of child elements and the aggregate state. The value of the LastPosition persisted property and the Complete values of each child element are included in the state string. The returned string may contain upper- and lower-case letters, numbers, the slash (/) character, and the dot (.) character.

Note that this string only describes the state that the player is aware of. If the shell stores additional data in the storyboard, it is the shell's responsibility to store the additional data if it is needed.

Parameters

sb:Storyboard — The storyboard to describe the state of.

Returns
String — The state of the storyboard.

See also

setStoryboardState()
resetStoryboard()
BasePlayer.setStoryboardState()
loadStoryboard()method 
override protected function loadStoryboard():void

Loads the storyboard.

This method is invoked by the storyboard property set method. Unlike other player classes, this method is invoked even if a null storyboard object is loaded. This method is invoked after initialization (if needed) occurs.

When loading a storyboard, the TimeSequencer performs the following actions:

See also

BasePlayer.loadStoryboard()
SequencerStatusTypes
removeCompleteRemainingCriteria()method 
override protected function removeCompleteRemainingCriteria():void

Removes known completion criteria from the CompleteRemaining storyboard persisted property.

This method is invoked by the checkForComplete() method if the value of the storyboard property is not null, and the complete event has not been dispatched since the storyboard was loaded.

In addition to the substrings processed by the BasePlayer, the AudioSequencer will remove the following substrings from the completeRemaining persisted property:

SubstringMeaning
commandObjectsComplete;All child elements have a Complete persisted property value of true.

See also

BasePlayer.removeCompleteRemainingCriteria()
resetStoryboard()method 
public static function resetStoryboard(sb:Storyboard):void

Removes all properties set by the player.

Note that this method also removes interim completion properties used by the player, but not necessarily set by the player.

Parameters

sb:Storyboard — The storyboard to remove properties from.

This method removes the following properties from a storyboard:

  • Initialized
  • CompleteRemaining
  • Complete
  • NarrationComplete
  • The Complete property of each ChildElement object in the storyboard's Commands ChildElementCollection property, if it exists.
  • LastPosition

This method removes the following properties from each ChildElement in the storyboard's children collection:

  • Complete

setStoryboardState()method 
public static function setStoryboardState(sb:Storyboard, state:String):void

Modifies the storyboard to match the described state passed.

If the value of state indicates a completed storyboard, interim completion criteria will be marked as complete in addition to the overall storyboard state.

State values created using a function other than getStoryboardState may not work.

Parameters

sb:Storyboard — The Storyboard object to modify.
 
state:String — A String created using the getStoryboardState() method containing the state to restore.

See also

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

Performs cleanup actions when a storyboard is unloaded.

This method is invoked by the storyboard property set method when the current value of the property is not null and the unload event has not been cancelled.

When unloading a storyboard, the TimeSequencer performs the following actions:

See also

BasePlayer.unloadStoryboard()
Event Detail
sequencerStatusChanged Event
Event Object Type: impression.events.SequencerStatusEvent
SequencerStatusEvent.type property = impression.events.SequencerStatusEvent.STATUS_CHANGED

Dispatched when the status of the sequencer changes.

The SequencerStatusEvent.STATUS_CHANGED constant defines the value of the type property of a status changed event object. This event has the following properties:
PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe object that is actively processing the Event object with an event listener.
targetThe object that raised the event.
sbThe Storyboard object assigned to the target.
statusThe status of the sequencer.
textAdditional information about the status.