| Package | org.osmf.traits |
| Class | public class TimeTrait |
| Inheritance | TimeTrait MediaTraitBase EventDispatcher Object |
| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | 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.
Related API Elements
| Property | Defined By | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | |
| currentTime : Number [read-only]
The current time of the media, in seconds. | TimeTrait | ||
| duration : Number [read-only]
The duration of the media, in seconds. | TimeTrait | ||
![]() | prototype : Object [static]
A reference to the prototype object of a class or function object. | Object | |
![]() | traitType : String [read-only]
The MediaTraitType for this trait. | MediaTraitBase | |
| Method | Defined By | ||
|---|---|---|---|
Constructor. | TimeTrait | ||
![]() | 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 | |
![]() |
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 | |
![]() |
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 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 | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
![]() | [broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | ||
| Dispatched when the currentTime of the trait has changed to a value equal to its duration. | TimeTrait | |||
![]() | [broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | ||
| Dispatched when the duration of the trait changed. | TimeTrait | |||
currentTime | property |
duration | property |
TimeTrait | () | Constructor |
currentTimeChangeEnd | () | method |
currentTimeChangeStart | () | method |
protected function currentTimeChangeStart(newCurrentTime:Number):void| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | 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.
Parameters
newCurrentTime:Number — New currentTime value.
|
durationChangeEnd | () | method |
protected function durationChangeEnd(oldDuration:Number):void| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | 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.
Parameters
oldDuration:Number — Previous duration value.
|
durationChangeStart | () | method |
protected function durationChangeStart(newDuration:Number):void| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | 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.
Parameters
newDuration:Number — New duration value.
|
setCurrentTime | () | method |
protected final function setCurrentTime(value:Number):void| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Invoking this setter will result in the trait's currentTime value changing if it differs from currentTime's current value.
Parameters
value:Number |
setDuration | () | method |
complete | Event |
org.osmf.events.TimeEventproperty TimeEvent.type =
org.osmf.events.TimeEvent.COMPLETE| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | 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 | Event |
org.osmf.events.TimeEventproperty TimeEvent.type =
org.osmf.events.TimeEvent.DURATION_CHANGE| Language Version: | ActionScript 3.0 |
| Product Version: | OSMF 1.0 |
| Runtime Versions: | 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.Mon Nov 28 2011, 06:48 AM -08:00
Hide Inherited Public Properties
Show Inherited Public Properties