套件 | org.osmf.traits |
類別 | public class LoaderBase |
繼承 | LoaderBase EventDispatcher Object |
子類別 | F4MLoader, ImageLoader, ManifestLoaderBase, NetLoader, SoundLoader, SWFLoader |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
方法 | 定義自 | ||
---|---|---|---|
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
Indicates whether this loader is capable of handling (loading)
the given MediaResourceBase. | LoaderBase | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
Loads the specified LoadTrait. | LoaderBase | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
Unloads the specified LoadTrait. | LoaderBase | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
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 |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | |||
Dispatched when the state of a LoadTrait being loaded or unloaded by the LoaderBase has changed. | LoaderBase |
canHandleResource | () | 方法 |
public function canHandleResource(resource:MediaResourceBase):Boolean
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Indicates whether this loader is capable of handling (loading) the given MediaResourceBase.
參數
resource:MediaResourceBase — The media resource in question.
|
Boolean — True if this loader can handle the given resource.
|
executeLoad | () | 方法 |
protected function executeLoad(loadTrait:org.osmf.traits:LoadTrait):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
參數
loadTrait:org.osmf.traits:LoadTrait |
executeUnload | () | 方法 |
protected function executeUnload(loadTrait:org.osmf.traits:LoadTrait):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
參數
loadTrait:org.osmf.traits:LoadTrait |
load | () | 方法 |
public final function load(loadTrait:org.osmf.traits:LoadTrait):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
參數
loadTrait:org.osmf.traits:LoadTrait — The LoadTrait to load.
|
擲回值
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 .
|
相關 API 元素
unload | () | 方法 |
public final function unload(loadTrait:org.osmf.traits:LoadTrait):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
參數
loadTrait:org.osmf.traits:LoadTrait — The LoadTrait to unload.
|
擲回值
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 .
|
相關 API 元素
updateLoadTrait | () | 方法 |
protected final function updateLoadTrait(loadTrait:org.osmf.traits:LoadTrait, newState:String):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Updates the given LoadTrait with the given info, and dispatches the state change event if necessary.
參數
loadTrait:org.osmf.traits:LoadTrait — The LoadTrait to update.
| |
newState:String — The new LoadState of the LoadTrait.
|
loadStateChange | 事件 |
org.osmf.events.LoaderEvent
屬性 LoaderEvent.type =
org.osmf.events.LoaderEvent.LOAD_STATE_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.Tue Jun 12 2018, 03:47 PM Z