Packagecom.brightcove.api.components
Classpublic class SWFLoader
InheritanceSWFLoader Inheritance UIObject Inheritance Component Inheritance flash.events.EventDispatcher

The SWFLoader UI component in the player allows you to specify a custom-developed SWF to be loaded, positioned, and sized within a player. For more code examples, see Working with SWFLoaders in the Player API and Player API Examples.



Public Properties
 PropertyDefined By
 Inheritedcomponent : Object
[read-only] Returns a reference to the wrapped API element in the player, which can be used to get access to new methods that might not be defined within this version of the SWC.
Component
Public Methods
 MethodDefined By
  
SWFLoader(element:Object)
Constructor.
SWFLoader
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = true):void
[override] Adds a listener for an event.
UIObject
  
callSWFMethod(method:String, ... params):Object
Calls a method on the loaded SWF instance.
SWFLoader
 Inherited
getAlpha():Number
Returns the alpha value of the component.
Component
 Inherited
getBlendMode():String
Returns the blend mode of the component.
UIObject
 Inherited
Returns the interface for the layout container of the element.
Component
 Inherited
getCSS():String
Returns the CSS used for this component instance.
UIObject
 Inherited
getDefinition():String
Returns the XML (BEML) definition of the component.
Component
 Inherited
getEnabled():Boolean
Returns whether component is enabled.
UIObject
 Inherited
getHeight():Number
Returns the pixel height of the component.
Component
 Inherited
getID():String
Returns the ID of the component, as defined in the XML.
Component
 Inherited
Returns whether the component is included in layout calculations and rendering in parent layout box.
Component
 Inherited
getIndex():int
Returns the index of this element in its parent's elements array.
Component
 Inherited
Returns the interface for the layout element that is the next sibling to this element in the parent containers's element array.
Component
 Inherited
getNodeName():String
Returns the node name of the element.
Component
 Inherited
Returns the interface for the layout element that is the previous sibling to this element in the parent containers's element array.
Component
 Inherited
getRotation():Number
Returns the rotation of the component.
UIObject
  
getSource():String
Returns the name or path of the image loaded/attached.
SWFLoader
  
getState():String
Gets the current loading state of the SWFLoader.
SWFLoader
 Inherited
getVisible():Boolean
Returns whether the component is visible.
Component
 Inherited
getWidth():Number
Returns the pixel width of the component.
Component
 Inherited
getX(global:Boolean = false):Number
Returns the position of the component on the x axis.
Component
 Inherited
getY(global:Boolean = false):Number
Returns the position of the component on the y axis.
Component
 Inherited
move(x:Number, y:Number, global:Boolean = false):void
Sets the x,y coordinates of the component.
Component
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
[override] Removes a listener for an event.
UIObject
 Inherited
setAlpha(alpha:Number):void
Sets the alpha value of the component.
Component
 Inherited
setBlendMode(mode:String):void
Sets the blend mode of the component.
UIObject
 Inherited
setEnabled(enable:Boolean):void
Enables/disables component for events.
UIObject
 Inherited
setIncludeInLayout(includeInLayout:Boolean):void
Sets whether the component is included in layout calculations and rendering in parent layout box.
Component
 Inherited
setRotation(rotation:Number):void
Sets the rotation of the component.
UIObject
 Inherited
setSize(width:Number, height:Number):void
Sets the pixel dimensions for the wrapped component.
Component
  
setSource(url:String):void
Loads the specified image or attaches the specified library symbol.
SWFLoader
 Inherited
setStyles(styles:String):void
Overrides specific styles for a component by accepting a semicolon-delimited list of style names and colors.
UIObject
 Inherited
setVisible(visible:Boolean):void
Sets whether the component is visible.
Component
Protected Methods
 MethodDefined By
  
redispatchEvent(event:Event):void
[override] Sends the specified event, usually sent from a handler in order to bubble up non-bubbling events.
SWFLoader
Events
 Event Summary Defined By
 InheritedDispatched when a UI element in the player is clicked.Component
 InheritedDispatched when a UI element in the player is rolled off.Component
 InheritedDispatched when a UI element in the player is rolled over.Component
  Dispatched when the external content has been completely downloaded and the loading is finished.SWFLoader
  Dispatched if the external content fails to load.SWFLoader
  Dispatched when the external content is ready to run first frame scripts (if a SWF).SWFLoader
  Dispatched while the external content is loading.SWFLoader
 InheritedDispatched when a property changes in a bindable component.Component
Public Constants
 ConstantDefined By
  DEFAULT : String = default
[static] The SWFLoader.DEFAULT constant defines the state of the SWFLoader if a source has not been provided (either through BEML or through the API).
SWFLoader
  ERROR : String = error
[static] The SWFLoader.ERROR constant defines the state of the SWFLoader if a loading operation has failed.
SWFLoader
  LOADED : String = loaded
[static] The SWFLoader.LOADED constant defines the state of the SWFLoader if a loading operation has completed.
SWFLoader
  LOADING : String = loading
[static] The SWFLoader.LOADING constant defines the state of the SWFLoader if a loading operation is actively occurring.
SWFLoader
Constructor Detail
SWFLoader()Constructor
public function SWFLoader(element:Object)

Constructor.

Parameters
element:Object — layout element to wrap and delegate all calls to.
Method Detail
callSWFMethod()method
public function callSWFMethod(method:String, ... params):Object

Calls a method on the loaded SWF instance.

Parameters

method:String — method to call.
 
... params — argument length -- the parameters to pass to the method.

Returns
Object — Whatever the specified method returns.
getSource()method 
public function getSource():String

Returns the name or path of the image loaded/attached.

Returns
String — The string name or path of the image loaded/attached.
getState()method 
public function getState():String

Gets the current loading state of the SWFLoader. Possible values:

Returns
String — The current state of the SWFLoader
redispatchEvent()method 
override protected function redispatchEvent(event:Event):void

Sends the specified event, usually sent from a handler in order to bubble up non-bubbling events.

Parameters

event:Event — event.

setSource()method 
public function setSource(url:String):void

Loads the specified image or attaches the specified library symbol.

Parameters

url:String — file path to the image, the name of the symbol to instantiate preceded by "lib:", or image class.

Event Detail
loaderComplete Event
Event Object Type: com.brightcove.api.events.LoaderEvent
LoaderEvent.type property = com.brightcove.api.events.LoaderEvent.COMPLETE

Dispatched when the external content has been completely downloaded and the loading is finished.

The LoaderEvent.COMPLETE constant defines the value of the type property of the event object for a loaderComplete event.
loaderError Event  
Event Object Type: com.brightcove.api.events.LoaderEvent
LoaderEvent.type property = com.brightcove.api.events.LoaderEvent.ERROR

Dispatched if the external content fails to load.

The LoaderEvent.ERROR constant defines the value of the type property of the event object for a loaderError event.
loaderInit Event  
Event Object Type: com.brightcove.api.events.LoaderEvent
LoaderEvent.type property = com.brightcove.api.events.LoaderEvent.INIT

Dispatched when the external content is ready to run first frame scripts (if a SWF).

The LoaderEvent.INIT constant defines the value of the type property of the event object for a loaderInit event.
loaderProgress Event  
Event Object Type: com.brightcove.api.events.LoaderEvent
LoaderEvent.type property = com.brightcove.api.events.LoaderEvent.PROGRESS

Dispatched while the external content is loading.

The LoaderEvent.PROGRESS constant defines the value of the type property of the event object for a loaderProgress event.
Constant Detail
DEFAULTConstant
public static const DEFAULT:String = default

The SWFLoader.DEFAULT constant defines the state of the SWFLoader if a source has not been provided (either through BEML or through the API).

ERRORConstant 
public static const ERROR:String = error

The SWFLoader.ERROR constant defines the state of the SWFLoader if a loading operation has failed.

LOADEDConstant 
public static const LOADED:String = loaded

The SWFLoader.LOADED constant defines the state of the SWFLoader if a loading operation has completed.

LOADINGConstant 
public static const LOADING:String = loading

The SWFLoader.LOADING constant defines the state of the SWFLoader if a loading operation is actively occurring. Listen for LoaderEvent.COMPLETE to know when a loading operation has completely finished.