Package | impression.players |
Class | public class RenderingPlayer |
Inheritance | RenderingPlayer ![]() ![]() |
Subclasses | CanvasPlayer, FlashObjectPlayer, RTFPlayer, SWFVideoPlayer |
Unlike BasePlayer, RenderingPlayer is not typically used in a runtime.
Property | Defined By | ||
---|---|---|---|
![]() | alwaysCheckComplete : Boolean
Specifies how the object should handle storyboard completion. | BasePlayer | |
![]() | narrationComplete : Boolean
Indicates whether narration has finished playing. | BasePlayer | |
renderingSurface : Sprite
The object to render content on. | RenderingPlayer | ||
resolver : AssetResolver
The AssetResolver to use to request external assets. | RenderingPlayer | ||
storyboard : Storyboard [override]
The storyboard associated with the player. | RenderingPlayer |
Method | Defined By | ||
---|---|---|---|
RenderingPlayer(renderingSurface:Sprite = null, resolver:AssetResolver = null)
Creates a new instance of the RenderingPlayer. | RenderingPlayer | ||
![]() | checkForComplete():void
Causes the player to examine the completion criteria for the current storyboard. | BasePlayer | |
clearStyle(style:String):void
Deletes a style property, reverting it back to its default value. | RenderingPlayer | ||
getStoryboardState(sb:Storyboard):String [static]
Creates a string describing the state of the storyboard. | RenderingPlayer | ||
getStyle(style:String):Object
Retrieves a style property. | RenderingPlayer | ||
getStyleDefinition():Object [static]
Retrieves the default style map for the current object. | RenderingPlayer | ||
redraw():void
Forces a complete redraw of the content. | RenderingPlayer | ||
resetStoryboard(sb:Storyboard):void [static]
Removes all properties set by the player. | RenderingPlayer | ||
setStoryboardState(sb:Storyboard, state:String):void [static] | RenderingPlayer | ||
setStyle(style:String, value:Object):void
Sets a style property. | RenderingPlayer |
Method | Defined By | ||
---|---|---|---|
detachSurface():void
Removes any connections between the rendering surface and the player. | RenderingPlayer | ||
eraseSurface():void
Removes all content from the surface. | RenderingPlayer | ||
![]() | initializeStoryboard():void
Initializes the storyboard. | BasePlayer | |
loadStoryboard():void [override]
Loads the storyboard. | RenderingPlayer | ||
maskSurface():void
Adds a mask to the rendering surface if the maskRenderingSurface style property value is true. | RenderingPlayer | ||
![]() |
Removes known completion criteria from the CompleteRemaining storyboard persisted property. | BasePlayer | |
renderBackground():void
Draws the background rectangle onto the rendering surface. | RenderingPlayer | ||
renderContent():void
Renders the content onto the rendering surface. | RenderingPlayer | ||
unloadStoryboard():void [override]
Performs cleanup actions when a storyboard is unloaded. | RenderingPlayer |
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 when the player begins to load external assets. | RenderingPlayer | |||
Dispatched when all external assets have finished loading. | RenderingPlayer | |||
Dispatched when some type of input or output failure occurs. | RenderingPlayer | |||
![]() | Dispatched after a storyboard is initialized. | BasePlayer | ||
Dispatched when some type of input or output failure occurs. | RenderingPlayer | |||
![]() | Dispatched when storyboard loading is complete. | BasePlayer | ||
![]() | Dispatched when a storyboard is loaded, but before any processing occurs. | BasePlayer | ||
Dispatched when some type of input or output failure occurs. | RenderingPlayer | |||
![]() | Dispatched before a storyboard is unloaded. | BasePlayer | ||
Dispatched when some type of input or output failure occurs. | RenderingPlayer |
renderingSurface | property |
renderingSurface:Sprite
The object to render content on.
If the existing rendering surface has existing content, it is not removed prior to setting the new surface. Note that any loading in progress will be cancelled, and all communication with and references to the player are removed.
You must manually invoke the redraw()
method
if you want to render the current storyboard onto the new surface.
public function get renderingSurface():Sprite
public function set renderingSurface(value:Sprite):void
resolver | property |
resolver:AssetResolver
The AssetResolver to use to request external assets. When this value is set to a non-null
value,
the player registers itself with the resolver as an owner, and all content requested is requested using itself
as the owner.
If the player is currently loading content, all load actions in progress will be cancelled when
this property is set. When removing the references to an existing resolver, the player will unregister itself
as an owner. If the new property value is not null
, the player will register itself as an owner.
public function get resolver():AssetResolver
public function set resolver(value:AssetResolver):void
storyboard | property |
storyboard:Storyboard
[override] The storyboard associated with the player.
If null
is passed, the current storyboard is
unloaded, the unload
event is dispatched, and
no further action occurs.
If a non-null
storyboard object is passed, the following actions occur, in order:
null
, the unload
event is dispatched. If the event is not cancelled, the current storyboard is unloaded. If the event is cancelled, further processing stops.null
, the loadStart
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
. Initialized
persisted property is false
, the storyboard is initialized and the initialize
event is dispatched.contentLoadBegin
event is dispatched.contentLoadEnd
event is dispatched, followed by the loadComplete
event.loadComplete
event was dispatched, the checkForComplete()
method is invoked. If all completion criteria have
been met, the complete
event is dispatched.If either the renderingSurface
or resolver
properties are null
, the content will not be rendered, and
no error will occur. Processing will continue as if all external assets have been loaded.
public function get storyboard():Storyboard
public function set storyboard(value:Storyboard):void
See also
RenderingPlayer | () | Constructor |
public function RenderingPlayer(renderingSurface:Sprite = null, resolver:AssetResolver = null)
Creates a new instance of the RenderingPlayer.
ParametersrenderingSurface:Sprite (default = null ) — The object to render content on.
| |
resolver:AssetResolver (default = null ) — The AssetResolver to use to request external assets.
|
clearStyle | () | method |
public function clearStyle(style:String):void
Deletes a style property, reverting it back to its default value.
Parameters
style:String — The name of the style property.
|
See also
detachSurface | () | method |
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. In the RenderingPlayer, this method
invokes the cancelOwnerTransaction()
method of the resolver.
Descendant classes override this method to perform additional actions.
eraseSurface | () | method |
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. In the RenderingPlayer, this method performs the following actions:
cancelOwnerTransaction()
method is invoked.closeAllOf()
method.removeChildAt()
method until no children remain on the surface.graphics
property's clear()
method is invoked.Note that this method is not invoked by the player if the surface is being detached by setting the renderingSurface
property.
Descendant classes override this method to perform additional actions.
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.
|
getStyle | () | method |
public function getStyle(style:String):Object
Retrieves a style property.
The type that this method returns varies depending on the style property that the method retrieves. The range of possible types includes Boolean; String; Number; int; a uint for an RGB color; a Class for a skin; or any kind of object.
If you call this method to retrieve a particular style property, it will be of a known type that you can store in a variable of the same type. Type casting is not necessary. Instead, a simple assignment statement like the following will work:
var backgroundColor:uint = getStyle("backgroundColor");
If the style property is not set in the style lookup chain, this method returns a value of
undefined
. Note that undefined
is a special value that is not the same
as false
, ""
, NaN
, 0
, or null
.
No valid style value is ever undefined.
Unlike classes based on UIComponent
, there is no inheritance chain
for RenderingPlayer or its derived classes. All styles are set on a per-instance basis.
Parameters
style:String — The name of the style property.
|
Object — Style value.
|
See also
getStyleDefinition | () | method |
public static function getStyleDefinition():Object
Retrieves the default style map for the current object.
The style map contains the type that is appropriate for the object, and is dependant on the styles that the object uses.
ReturnsObject — Default styles object.
|
See also
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 RenderingPlayer performs the following actions:
maskRenderingSurface
style property value is true
a new mask is added to the surface.See also
maskSurface | () | method |
protected function maskSurface():void
Adds a mask to the rendering surface if the maskRenderingSurface
style property value is true
.
The mask added to the surface is a Sprite. It is sized by drawing a rectangle on the Sprite's graphics
object using a transparent line style with 0 width and a transparent fill. Note that any existing mask will be removed by this
method, regardless of the maskRenderingSurface
style property value.
Descendant classes override this method to perform additional actions.
redraw | () | method |
public function redraw():void
Forces a complete redraw of the content.
renderBackground | () | method |
protected function renderBackground():void
Draws the background rectangle onto the rendering surface.
The background rectangle is drawn using the backgroundColor
, backgroundAlpha
, width
,
and height
style property values using a transparent line style with 0 width.
Note that the surface's graphics
object's clear()
method is invoked prior to drawing the background.
Descendant classes override this method to perform additional actions.
renderContent | () | method |
protected function renderContent():void
Renders the content onto the rendering surface.
As implemented by the RenderingPlayer class, this method performs no actions. Descendant classes override this method to render the content.
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:
|
See also
setStoryboardState | () | method |
public static function setStoryboardState(sb:Storyboard, state:String):void
Parameters
sb:Storyboard | |
state:String |
setStyle | () | method |
public function setStyle(style:String, value:Object):void
Sets a style property.
You must invoke the redraw()
to see style changes.
Parameters
style:String — The name of the style property.
| |
value:Object — The value of the style.
|
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 RenderingPlayer performs the following actions:
cancelOwnerTransaction()
method is invoked.closeAllOf()
method.graphics
property's clear()
method is invoked.See also
contentLoadBegin | Event |
impression.events.StoryboardEvent
impression.events.StoryboardEvent.CONTENT_LOAD_BEGIN
Dispatched when the player begins to load external assets.
This event is dispatched when the redraw()
method is
invoked, either explicitly or implicitly as the result of setting the
storyboard
property to a non-null
value.
This event will occur if any external assets are defined, even if
they cannot be loaded. This event is dispatched when the resolverInfo
object whose owner
property value is the player dispatches
its beginTransaction
event.
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. |
contentLoadEnd | Event |
impression.events.StoryboardEvent
impression.events.StoryboardEvent.CONTENT_LOAD_END
Dispatched when all external assets have finished loading.
This event will occur if any external assets are defined, even if
they cannot be loaded. This event is dispatched when the resolverInfo
object whose owner
property value is the player dispatches
its endTransaction
event.
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. |
diskError | Event |
flash.events.IOErrorEvent
flash.events.IOErrorEvent.DISK_ERROR
Dispatched when some type of input or output failure occurs.
ioError | Event |
flash.events.IOErrorEvent
flash.events.IOErrorEvent.IO_ERROR
Dispatched when some type of input or output failure occurs.
networkError | Event |
flash.events.IOErrorEvent
flash.events.IOErrorEvent.NETWORK_ERROR
Dispatched when some type of input or output failure occurs.
verifyError | Event |
flash.events.IOErrorEvent
flash.events.IOErrorEvent.VERIFY_ERROR
Dispatched when some type of input or output failure occurs.