Package | impression.players |
Class | public class MenuPlayer |
Inheritance | MenuPlayer ![]() ![]() |
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.
Method | Defined By | ||
---|---|---|---|
checkDestinations():void
Causes the MenuPlayer to dispatch LocationStatusRequestEvent events for each valid
destination. | MenuPlayer | ||
![]() | checkForComplete():void
Causes the player to examine the completion criteria for the current storyboard. | BasePlayer | |
getStoryboardState(sb:Storyboard):String [static]
Creates a string describing the state of the storyboard. | MenuPlayer | ||
resetStoryboard(sb:Storyboard):void [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 |
Method | Defined By | ||
---|---|---|---|
![]() | initializeStoryboard():void
Initializes the storyboard. | BasePlayer | |
loadStoryboard():void [override]
Loads the storyboard. | MenuPlayer | ||
[override]
Removes known completion criteria from the CompleteRemaining storyboard persisted property. | MenuPlayer | ||
![]() | unloadStoryboard():void
Performs cleanup actions when a storyboard is unloaded. | BasePlayer |
Event | Summary | Defined By | ||
---|---|---|---|---|
![]() | Dispatched when the BasePlayer needs to resolve completion criteria beyond those defined for the class. | BasePlayer | ||
![]() | Dispatched when a storyboard is marked as complete. | BasePlayer | ||
![]() | Dispatched after a storyboard is initialized. | BasePlayer | ||
![]() | Dispatched when storyboard loading is complete. | BasePlayer | ||
![]() | Dispatched when a storyboard is loaded, but before any processing occurs. | BasePlayer | ||
Dispatched when the player needs to determine the status of a destination. | MenuPlayer | |||
![]() | Dispatched before a storyboard is unloaded. | BasePlayer |
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.
|
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:
LocationStatusRequest
event is dispatched for each ChildElement in the storyboard's children
collection. The value of the event
object's status
property is saved to the element's DestinationStatus
persisted property.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:
Substring | Meaning |
---|---|
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:
|
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.
|
locationStatusRequest | Event |
impression.events.LocationStatusRequestEvent
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:Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The object that raised the event. |
sb | The Storyboard object assigned to the target. |
location | The location to determine the status of. |
status |
See also