套件 | org.osmf.traits |
類別 | public class TimeTrait |
繼承 | TimeTrait MediaTraitBase EventDispatcher Object |
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Use the MediaElement.hasTrait(MediaTraitType.TIME)
method to query
whether a media element has a trait of this type.
If hasTrait(MediaTraitType.TIME)
returns true
,
use the MediaElement.getTrait(MediaTraitType.TIME)
method
to get an object that is of this type.
相關 API 元素
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
currentTime : Number [唯讀]
The current time of the media, in seconds. | TimeTrait | ||
duration : Number [唯讀]
The duration of the media, in seconds. | TimeTrait | ||
traitType : String [唯讀]
The MediaTraitType for this trait. | MediaTraitBase |
方法 | 定義自 | ||
---|---|---|---|
Constructor. | TimeTrait | ||
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 | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
方法 | 定義自 | ||
---|---|---|---|
Called just after the currentTime property has changed. | TimeTrait | ||
Called immediately before the currentTime property is changed. | TimeTrait | ||
Called just after the duration property has changed. | TimeTrait | ||
Called immediately before the duration property is changed. | TimeTrait | ||
Invoking this setter will result in the trait's currentTime
value changing if it differs from currentTime's current value. | TimeTrait | ||
Invoking this setter will result in the trait's duration
value changing if it differs from duration's current value. | TimeTrait |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
Dispatched when the currentTime of the trait has changed to a value equal to its duration. | TimeTrait | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | |||
Dispatched when the duration of the trait changed. | TimeTrait |
currentTime | 屬性 |
duration | 屬性 |
TimeTrait | () | 建構函式 |
currentTimeChangeEnd | () | 方法 |
currentTimeChangeStart | () | 方法 |
protected function currentTimeChangeStart(newCurrentTime:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Called immediately before the currentTime
property is changed.
Subclasses can override this method to communicate the change to the media.
參數
newCurrentTime:Number — New currentTime value.
|
durationChangeEnd | () | 方法 |
protected function durationChangeEnd(oldDuration:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Called just after the duration
property has changed.
Dispatches the change event.
Subclasses that override should call this method to dispatch the durationChange event.
參數
oldDuration:Number — Previous duration value.
|
durationChangeStart | () | 方法 |
protected function durationChangeStart(newDuration:Number):void
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Called immediately before the duration
property is changed.
Subclasses can override this method to communicate the change to the media.
參數
newDuration:Number — New duration value.
|
setCurrentTime | () | 方法 |
setDuration | () | 方法 |
complete | 事件 |
org.osmf.events.TimeEvent
屬性 TimeEvent.type =
org.osmf.events.TimeEvent.COMPLETE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the currentTime of the trait has changed to a value equal to its duration.
The TimeEvent.COMPLETE constant defines the value of the type property of the event object for a complete event.durationChange | 事件 |
org.osmf.events.TimeEvent
屬性 TimeEvent.type =
org.osmf.events.TimeEvent.DURATION_CHANGE
語言版本: | ActionScript 3.0 |
產品版本: | OSMF 1.0 |
執行階段版本: | Flash Player 10, AIR 1.5 |
Dispatched when the duration of the trait changed.
The TimeEvent.DURATION_CHANGE constant defines the value of the type property of the event object for a durationChange event.Tue Jun 12 2018, 03:47 PM Z