Packageimpression.players
Classpublic class FlashObjectPlayer
InheritanceFlashObjectPlayer Inheritance RenderingPlayer Inheritance BasePlayer Inheritance flash.events.EventDispatcher

The FlashObjectPlayer class displays a single .SWF file.

The FlashObjectPlayer injects a reference to itself in the loaded .SWF file (as the .player property) at the root level of the .SWF. This injection allows the loaded .SWF object to communicate with the player. Content and shell authors can define a bidirectional communication architecture that deeply integrates the content with the runtime.

The sample shell included in the DevKit shows one possible approach to bidirectional communication.



Public Properties
 PropertyDefined By
 InheritedalwaysCheckComplete : Boolean
Specifies how the object should handle storyboard completion.
BasePlayer
  _content : DisplayObject
[read-only] Returns the DispalyObject associated with the loader.
FlashObjectPlayer
  _loader : LoaderEx
[read-only] Returns the loader object.
FlashObjectPlayer
 InheritednarrationComplete : Boolean
Indicates whether narration has finished playing.
BasePlayer
 InheritedrenderingSurface : Sprite
The object to render content on.
RenderingPlayer
 Inheritedresolver : AssetResolver
The AssetResolver to use to request external assets.
RenderingPlayer
 Inheritedstoryboard : Storyboard
[override] The storyboard associated with the player.
RenderingPlayer
Public Methods
 MethodDefined By
  
FlashObjectPlayer(renderingSurface:Sprite = null, resolver:AssetResolver = null)
Creates a new instance of the FlashObjectPlayer.
FlashObjectPlayer
 Inherited
Causes the player to examine the completion criteria for the current storyboard.
BasePlayer
 Inherited
clearStyle(style:String):void
Deletes a style property, reverting it back to its default value.
RenderingPlayer
  
[static]
FlashObjectPlayer
 Inherited
getStyle(style:String):Object
Retrieves a style property.
RenderingPlayer
  
[static] Retrieves the default style map for the FlashObjectPlayer.
FlashObjectPlayer
 Inherited
redraw():void
Forces a complete redraw of the content.
RenderingPlayer
  
[static] Removes all properties set by the player.
FlashObjectPlayer
  
setStoryboardState(sb:Storyboard, state:String):void
[static]
FlashObjectPlayer
 Inherited
setStyle(style:String, value:Object):void
Sets a style property.
RenderingPlayer
Protected Methods
 MethodDefined By
  
[override] Removes any connections between the rendering surface and the player.
FlashObjectPlayer
  
[override] Removes all content from the surface.
FlashObjectPlayer
 Inherited
Initializes the storyboard.
BasePlayer
 Inherited
[override] Loads the storyboard.
RenderingPlayer
 Inherited
Adds a mask to the rendering surface if the maskRenderingSurface style property value is true.
RenderingPlayer
  
[override] Removes known completion criteria from the CompleteRemaining storyboard persisted property.
FlashObjectPlayer
 Inherited
Draws the background rectangle onto the rendering surface.
RenderingPlayer
  
[override] Renders the content onto the surface.
FlashObjectPlayer
  
[override] Performs cleanup actions when a storyboard is unloaded.
FlashObjectPlayer
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 when the player begins to load external assets.RenderingPlayer
 InheritedDispatched when all external assets have finished loading.RenderingPlayer
 InheritedDispatched when some type of input or output failure occurs.RenderingPlayer
 InheritedDispatched after a storyboard is initialized.BasePlayer
 InheritedDispatched when some type of input or output failure occurs.RenderingPlayer
 InheritedDispatched when storyboard loading is complete.BasePlayer
 InheritedDispatched when a storyboard is loaded, but before any processing occurs.BasePlayer
 InheritedDispatched when some type of input or output failure occurs.RenderingPlayer
 InheritedDispatched before a storyboard is unloaded.BasePlayer
 InheritedDispatched when some type of input or output failure occurs.RenderingPlayer
Styles
 Style Description Defined By
 InheritedType: Boolean
Whether or not the primary asset should be resized when loaded to width x height.
RenderingPlayer
 InheritedType: Number
The background color transparency of the rendering surface.
RenderingPlayer
 InheritedType: uint Format: Color
The background color of the rendering surface.
RenderingPlayer
 InheritedType: Boolean
The value of all assets' cacheAsBitmap property that the player should set once the asset is loaded.
RenderingPlayer
 InheritedType: Object
The default LoaderContext object to use when assets are loaded.
RenderingPlayer
 InheritedType: Number Format: Length
The height of the rendering surface, in pixels.
RenderingPlayer
 InheritedType: Boolean
Whether or not the rendering surface should be masked to width x height.
RenderingPlayer
 InheritedType: Number Format: Length
The width of the rendering surface, in pixels.
RenderingPlayer
Property Detail
_contentproperty
_content:DisplayObject  [read-only]

Returns the DispalyObject associated with the loader.


Implementation
    public function get _content():DisplayObject
_loaderproperty 
_loader:LoaderEx  [read-only]

Returns the loader object.


Implementation
    public function get _loader():LoaderEx
Constructor Detail
FlashObjectPlayer()Constructor
public function FlashObjectPlayer(renderingSurface:Sprite = null, resolver:AssetResolver = null)

Creates a new instance of the FlashObjectPlayer.

Parameters
renderingSurface:Sprite (default = null) — The object to render content on.
 
resolver:AssetResolver (default = null) — The AssetResolver to use to request external assets.
Method Detail
detachSurface()method
override protected function detachSurface():void

Removes any connections between the rendering surface and the player.

This method is invoked by the player when a storyboard is unloaded, the redraw() method is invoked, or the renderingSurface property is changed. When detaching a rendering surface, the FlashObjectPlayer performs the following actions:

See also

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

Removes all content from the surface.

This method is invoked by the player when a storyboard is unloaded or when the redraw() method is invoked. When erasing a rendering surface, the FlashObjectPlayer performs the following actions:

See also

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

Parameters

sb:Storyboard

Returns
String
getStyleDefinition()method 
public static function getStyleDefinition():Object

Retrieves the default style map for the FlashObjectPlayer.

Returns
Object — Default styles object.
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.

The Content Creation Tool allows content authors to add a value of objectDefined; to the CompleteWhen persisted property. The FlashObjectPlayer does not remove this value. It is expected that the loaded Flash object or the shell itself will remove the value.

See also

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

Renders the content onto the surface.

To render content, the FlashObjectPlayer performs the following actions:

Note that the reference to the player is not injected into the Flash object until the loader responsible for loading the Flash object dispatches the Event.INIT event.

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.

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

Parameters

sb:Storyboard
 
state:String

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. For the BasePlayer, this method removes the internal reference to the old storyboard.

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

See also