Package | org.osmf.traits |
Class | public class LoadTrait |
Inheritance | LoadTrait MediaTraitBase EventDispatcher Object |
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
If hasTrait(MediaTraitType.LOAD)
returns true
,
use the MediaElement.getTrait(MediaTraitType.LOAD)
method
to get an object of this type.
Related API Elements
Property | Defined By | ||
---|---|---|---|
bytesLoaded : Number [read-only]
The number of bytes of data that have been loaded. | LoadTrait | ||
bytesTotal : Number [read-only]
The total size in bytes of the data being loaded. | LoadTrait | ||
constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | ||
loadState : String [read-only]
The load state of this trait. | LoadTrait | ||
resource : MediaResourceBase [read-only]
Resource representing the piece of media to be loaded into
this LoadTrait. | LoadTrait | ||
traitType : String [read-only]
The MediaTraitType for this trait. | MediaTraitBase |
Method | Defined By | ||
---|---|---|---|
Constructor. | LoadTrait | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event. | EventDispatcher | ||
Dispatches an event into the event flow. | EventDispatcher | ||
Disposes of any resources used by this trait. | MediaTraitBase | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event. | EventDispatcher | ||
Indicates whether an object has a specified property defined. | Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | ||
Loads this the media into this LoadTrait. | LoadTrait | ||
Indicates whether the specified property exists and is enumerable. | Object | ||
Removes a listener from the EventDispatcher object. | EventDispatcher | ||
Sets the availability of a dynamic property for loop operations. | Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | ||
Returns the string representation of the specified object. | Object | ||
Unloads this LoadTrait. | LoadTrait | ||
Returns the primitive value of the specified object. | Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type. | EventDispatcher |
Method | Defined By | ||
---|---|---|---|
Called just after the bytesLoaded property has changed. | LoadTrait | ||
Called immediately before the bytesLoaded property is changed. | LoadTrait | ||
Called just after the bytesTotal property has changed. | LoadTrait | ||
Called immediately before the bytesTotal property is changed. | LoadTrait | ||
Called just after the loadState property is
change. | LoadTrait | ||
Called immediately before the loadState
property is changed. | LoadTrait | ||
Sets the number of bytes of data that have been loaded. | LoadTrait | ||
Sets the total size in bytes of the data being loaded. | LoadTrait | ||
Sets the load state for this LoadTrait. | LoadTrait |
Event | Summary | Defined By | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
Dispatched when total size in bytes of data being loaded has changed. | LoadTrait | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when the state of the LoadTrait has changed. | LoadTrait |
bytesLoaded | property |
bytesTotal | property |
loadState | property |
resource | property |
resource:MediaResourceBase
[read-only] Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Resource representing the piece of media to be loaded into this LoadTrait.
Implementation
public function get resource():MediaResourceBase
LoadTrait | () | Constructor |
public function LoadTrait(loader:LoaderBase, resource:MediaResourceBase)
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Constructor.
Parametersloader:LoaderBase — The LoaderBase instance that will be used to load the
media for the media element that owns this trait.
| |
resource:MediaResourceBase — The MediaResourceBase instance that represents the media resource
to be loaded.
|
bytesLoadedChangeEnd | () | method |
protected function bytesLoadedChangeEnd():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Called just after the bytesLoaded
property has changed.
bytesLoadedChangeStart | () | method |
protected function bytesLoadedChangeStart(newValue:Number):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Called immediately before the bytesLoaded
property is changed.
Subclasses can override this method to communicate the change to the media.
Parameters
newValue:Number — New bytesLoaded value.
|
bytesTotalChangeEnd | () | method |
protected function bytesTotalChangeEnd():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Called just after the bytesTotal
property has changed.
Dispatches the bytesTotalChange event.
Subclasses that override should call this method to dispatch the bytesTotalChange event.
bytesTotalChangeStart | () | method |
protected function bytesTotalChangeStart(newValue:Number):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Called immediately before the bytesTotal
property is changed.
Subclasses can override this method to communicate the change to the media.
Parameters
newValue:Number — New bytesTotal value.
|
load | () | method |
public function load():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Loads this the media into this LoadTrait.
Updates the load state.
Dispatches the loadStateChange
event with every state change.
Typical states are LOADING
while the media is loading,
READY
after it has successfully completed loading,
and LOAD_ERROR
if it fails to complete loading.
If the LoadState is LOADING
or READY
when the method is called, throws an error.
Throws
IllegalOperationError — If this trait is unable to load
itself or if the LoadState is LOADING or
READY .
|
Related API Elements
loadStateChangeEnd | () | method |
protected function loadStateChangeEnd():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Called just after the loadState
property is
change.
loadStateChangeStart | () | method |
protected function loadStateChangeStart(newState:String):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Called immediately before the loadState
property is changed.
Subclasses can override this method to communicate the change to the media.
Parameters
newState:String — New loadState value.
|
setBytesLoaded | () | method |
protected final function setBytesLoaded(value:Number):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Sets the number of bytes of data that have been loaded.
Parameters
value:Number |
Throws
ArgumentError — If value is negative, NaN, or greater than bytesTotal.
|
setBytesTotal | () | method |
protected final function setBytesTotal(value:Number):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Sets the total size in bytes of the data being loaded.
Parameters
value:Number |
Throws
ArgumentError — If value is negative or smaller than bytesLoaded.
|
setLoadState | () | method |
unload | () | method |
public function unload():void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Unloads this LoadTrait. Updates the load state.
Dispatches the loadStateChange
event with every state change.
Typical states are UNLOADING
while the media is unloading,
UNINITIALIZED
after it has successfully completed unloading,
and LOAD_ERROR
if it fails to complete unloading.
If the LoadState is not READY
when the
method is called, throws an error.
Throws
IllegalOperationError — If this trait is unable to unload
itself, or if the LoadState is not READY .
|
Related API Elements
bytesTotalChange | Event |
org.osmf.events.LoadEvent
property LoadEvent.type =
org.osmf.events.LoadEvent.BYTES_TOTAL_CHANGE
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Dispatched when total size in bytes of data being loaded has changed.
The LoadEvent.BYTES_TOTAL_CHANGE constant defines the value of the type property of the event object for a bytesTotalChange event.loadStateChange | Event |
org.osmf.events.LoadEvent
property LoadEvent.type =
org.osmf.events.LoadEvent.LOAD_STATE_CHANGE
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Dispatched when the state of the LoadTrait has changed.
The LoadEvent.LOAD_STATE_CHANGE constant defines the value of the type property of the event object for a loadStateChange event.Thu Dec 6 2018, 01:12 PM -08:00