Packageimpression.players
Classpublic class MenuPlayer
InheritanceMenuPlayer Inheritance BasePlayer Inheritance flash.events.EventDispatcher

The MenuPlayer class supports playback of menu type storyboards. A menu type storyboard consists of 0 or more ChildElement objects; with each one containing a LocationData object specifying a destination and a title string for display.

The MenuPlayer class is a face-based player; all drawing and interaction is handled by the shell. Like most face-based players, the MenuPlayer class is designed to encapsulate the logic required to manage menu storyboards and make the development of menu interfaces as simple as possible.



Public Properties
 PropertyDefined By
 InheritedalwaysCheckComplete : Boolean
Specifies how the object should handle storyboard completion.
BasePlayer
 InheritednarrationComplete : Boolean
Indicates whether narration has finished playing.
BasePlayer
 Inheritedstoryboard : Storyboard
Specifies the storyboard for the player.
BasePlayer
Public Methods
 MethodDefined By
  
Causes the MenuPlayer to dispatch LocationStatusRequestEvent events for each valid destination.
MenuPlayer
 Inherited
Causes the player to examine the completion criteria for the current storyboard.
BasePlayer
  
[static] Creates a string describing the state of the storyboard.
MenuPlayer
  
[static] Removes all properties set by the player.
MenuPlayer
  
setStoryboardState(sb:Storyboard, state:String):void
[static] Modifies the storyboard to match the described state passed.
MenuPlayer
Protected Methods
 MethodDefined By
 Inherited
Initializes the storyboard.
BasePlayer
  
[override] Loads the storyboard.
MenuPlayer
  
[override] Removes known completion criteria from the CompleteRemaining storyboard persisted property.
MenuPlayer
 Inherited
Performs cleanup actions when a storyboard is unloaded.
BasePlayer
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 player needs to determine the status of a destination.MenuPlayer
 InheritedDispatched before a storyboard is unloaded.BasePlayer
Method Detail
checkDestinations()method
public function checkDestinations():void

Causes the MenuPlayer to dispatch LocationStatusRequestEvent events for each valid destination.

See also

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

Creates a string describing the state of the storyboard.

This method returns a single character to describe the state of the storyboard. If the storyboard is marked complete, "c" is returned. If the storyboard has been initialized, but is not marked complete, "i" is returned. Otherwise "." is returned.

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.
loadStoryboard()method 
override protected function loadStoryboard():void

Loads the storyboard.

This method is invoked by the storyboard property set method when a non-null storyboard object is loaded after initialization (if needed) occurs.

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

See also

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 CanvasPlayer will remove the following substrings from the completeRemaining persisted property:

SubstringMeaning
destinationsComplete;All ChildElements must have a DestinationStatus persisted property with a value of LocationStatusTypes.COMPLETE.

See also

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 DestinationStatus property of each ChildElement object in the storyboard's Commands ChildElementCollection property, if it exists.

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 is "c" (indicating 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.

Event Detail
locationStatusRequest Event
Event Object Type: impression.events.LocationStatusRequestEvent
LocationStatusRequestEvent.type property = impression.events.LocationStatusRequestEvent.LOCATION_STATUS_REQUEST

Dispatched when the player needs to determine the status of a destination. This event is dispatched for each valid destination in the storyboard, and occurs when the storyboard is loaded and when the checkDestinations() method is invoked.

The LocationStatusRequestEvent.LOCATION_STATUS_REQUEST constant defines the value of the type property of a location status request 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.
locationThe location to determine the status of.
status

See also