Package | org.osmf.traits |
Class | public class LoaderBase |
Inheritance | LoaderBase EventDispatcher Object |
Subclasses | F4MLoader, ImageLoader, ManifestLoaderBase, NetLoader, SoundLoader, SWFLoader |
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
A MediaElement that has the LoadTrait uses a LoaderBase to perform the actual load operation. This decoupling of the loading and unloading from the media allows a MediaElement to use different loaders for different circumstances.
Method | Defined By | ||
---|---|---|---|
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 | ||
Indicates whether this loader is capable of handling (loading)
the given MediaResourceBase. | LoaderBase | ||
Dispatches an event into the event flow. | EventDispatcher | ||
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 the specified LoadTrait. | LoaderBase | ||
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 the specified LoadTrait. | LoaderBase | ||
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 | ||
---|---|---|---|
Executes the load of the given LoadTrait. | LoaderBase | ||
Executes the unload of the given LoadTrait. | LoaderBase | ||
Updates the given LoadTrait with the given info, and dispatches the
state change event if necessary. | LoaderBase |
Event | Summary | Defined By | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when the state of a LoadTrait being loaded or unloaded by the LoaderBase has changed. | LoaderBase |
canHandleResource | () | method |
public function canHandleResource(resource:MediaResourceBase):Boolean
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Indicates whether this loader is capable of handling (loading) the given MediaResourceBase.
Parameters
resource:MediaResourceBase — The media resource in question.
|
Boolean — True if this loader can handle the given resource.
|
executeLoad | () | method |
protected function executeLoad(loadTrait:org.osmf.traits:LoadTrait):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Executes the load of the given LoadTrait.
This method is invoked by load()
.
Subclasses should override this method to provide their
own implementation of the load operation.
Parameters
loadTrait:org.osmf.traits:LoadTrait |
executeUnload | () | method |
protected function executeUnload(loadTrait:org.osmf.traits:LoadTrait):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Executes the unload of the given LoadTrait.
This method is invoked by unload()
.
Subclasses should override this method to provide their
own implementation of the unload operation.
Parameters
loadTrait:org.osmf.traits:LoadTrait |
load | () | method |
public final function load(loadTrait:org.osmf.traits:LoadTrait):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Loads the specified LoadTrait. Changes the load state of the LoadTrait.
Dispatches the loadStateChange
event with every state change.
Typical states are LOADING
while the LoadTrait is loading,
READY
after it has successfully completed loading,
and LOAD_ERROR
if it fails to complete loading.
If the LoadTrait's LoadState is LOADING
or
READY
when the method is called, this method throws
an error.
Subclasses should override the executeLoad
method to perform
the actual load operation.
Parameters
loadTrait:org.osmf.traits:LoadTrait — The LoadTrait to load.
|
Throws
IllegalOperationError — IllegalOperationError
If this loader cannot load the given LoadTrait (as determined by
the canHandleResource() method),
or if the LoadTrait's LoadState is LOADING or
READY .
|
Related API Elements
unload | () | method |
public final function unload(loadTrait:org.osmf.traits:LoadTrait):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Unloads the specified LoadTrait. Changes the load state of the LoadTrait.
Dispatches the loaderStateChange
event with every state change.
Typical states are UNLOADING
while the LoadTrait is unloading,
UNINITIALIZED
after it has successfully completed unloading,
and LOAD_ERROR
if it fails to complete unloading.
If the LoadTrait's LoadState is not READY
when the method
is called, this method throws an error.
Subclasses should override the executeUnload
method to perform
the actual unload operation.
Parameters
loadTrait:org.osmf.traits:LoadTrait — The LoadTrait to unload.
|
Throws
IllegalOperationError — IllegalOperationError
If this loader cannot unload the specified LoadTrait (as determined by
the canHandleResource() method),
or if the LoadTrait's LoadState is not READY .
|
Related API Elements
updateLoadTrait | () | method |
protected final function updateLoadTrait(loadTrait:org.osmf.traits:LoadTrait, newState:String):void
Language Version: | ActionScript 3.0 |
Product Version: | OSMF 1.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Updates the given LoadTrait with the given info, and dispatches the state change event if necessary.
Parameters
loadTrait:org.osmf.traits:LoadTrait — The LoadTrait to update.
| |
newState:String — The new LoadState of the LoadTrait.
|
loadStateChange | Event |
org.osmf.events.LoaderEvent
property LoaderEvent.type =
org.osmf.events.LoaderEvent.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 a LoadTrait being loaded or unloaded by the LoaderBase has changed.
The LoaderEvent.LOAD_STATE_CHANGE constant defines the value of the type property of the event object for a loadStateChange event.Mon Nov 28 2011, 06:48 AM -08:00