套件 | org.osmf.traits |
類別 | public class LoadTrait |
繼承 | LoadTrait MediaTraitBase EventDispatcher Object |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
相關 API 元素
屬性 | 定義自 | ||
---|---|---|---|
bytesLoaded : Number [唯讀]
The number of bytes of data that have been loaded. | LoadTrait | ||
bytesTotal : Number [唯讀]
The total size in bytes of the data being loaded. | LoadTrait | ||
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
loadState : String [唯讀]
The load state of this trait. | LoadTrait | ||
resource : MediaResourceBase [唯讀]
Resource representing the piece of media to be loaded into
this LoadTrait. | LoadTrait | ||
traitType : String [唯讀]
The MediaTraitType for this trait. | MediaTraitBase |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | LoadTrait | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
Disposes of any resources used by this trait. | MediaTraitBase | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
Loads this the media into this LoadTrait. | LoadTrait | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
Unloads this LoadTrait. | LoadTrait | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
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 |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
Dispatched when total size in bytes of data being loaded has changed. | LoadTrait | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | |||
Dispatched when the state of the LoadTrait has changed. | LoadTrait |
bytesLoaded | 屬性 |
bytesTotal | 屬性 |
loadState | 屬性 |
resource | 屬性 |
resource:MediaResourceBase
[唯讀] 語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Resource representing the piece of media to be loaded into this LoadTrait.
實作
public function get resource():MediaResourceBase
LoadTrait | () | 建構函式 |
public function LoadTrait(loader:LoaderBase, resource:MediaResourceBase)
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Constructor.
參數loader: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 | () | 方法 |
protected function bytesLoadedChangeEnd():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Called just after the bytesLoaded
property has changed.
bytesLoadedChangeStart | () | 方法 |
protected function bytesLoadedChangeStart(newValue:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
參數
newValue:Number — New bytesLoaded value.
|
bytesTotalChangeEnd | () | 方法 |
protected function bytesTotalChangeEnd():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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 | () | 方法 |
protected function bytesTotalChangeStart(newValue:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
參數
newValue:Number — New bytesTotal value.
|
load | () | 方法 |
public function load():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
擲回值
IllegalOperationError — If this trait is unable to load
itself or if the LoadState is LOADING or
READY .
|
相關 API 元素
loadStateChangeEnd | () | 方法 |
protected function loadStateChangeEnd():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Called just after the loadState
property is
change.
loadStateChangeStart | () | 方法 |
protected function loadStateChangeStart(newState:String):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
參數
newState:String — New loadState value.
|
setBytesLoaded | () | 方法 |
protected final function setBytesLoaded(value:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Sets the number of bytes of data that have been loaded.
參數
value:Number |
擲回值
ArgumentError — If value is negative, NaN, or greater than bytesTotal.
|
setBytesTotal | () | 方法 |
protected final function setBytesTotal(value:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Sets the total size in bytes of the data being loaded.
參數
value:Number |
擲回值
ArgumentError — If value is negative or smaller than bytesLoaded.
|
setLoadState | () | 方法 |
unload | () | 方法 |
public function unload():void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.
擲回值
IllegalOperationError — If this trait is unable to unload
itself, or if the LoadState is not READY .
|
相關 API 元素
bytesTotalChange | 事件 |
org.osmf.events.LoadEvent
屬性 LoadEvent.type =
org.osmf.events.LoadEvent.BYTES_TOTAL_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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 | 事件 |
org.osmf.events.LoadEvent
屬性 LoadEvent.type =
org.osmf.events.LoadEvent.LOAD_STATE_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | 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.Tue Jun 12 2018, 03:47 PM Z