ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
org.osmf.traits 

SeekTrait  - AS3 OSMF

Packageorg.osmf.traits
Classpublic class SeekTrait
InheritanceSeekTrait Inheritance MediaTraitBase Inheritance EventDispatcher Inheritance Object

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

SeekTrait defines the trait interface for media that can be instructed to jump to a position in time. It can also be used as the base class for a more specific SeekTrait subclass.

Use the MediaElement.hasTrait(MediaTraitType.SEEK) method to query whether a media element has a trait of this type. If hasTrait(MediaTraitType.SEEK) returns true, use the MediaElement.getTrait(MediaTraitType.SEEK) method to get an object that is guaranteed to be of this type.

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  seeking : Boolean
[read-only] Indicates whether the media is currently seeking.
SeekTrait
 InheritedtraitType : String
[read-only] The MediaTraitType for this trait.
MediaTraitBase
Protected Properties
 PropertyDefined By
  timeTrait : org.osmf.traits:TimeTrait
The TimeTrait used by this SeekTrait.
SeekTrait
Public Methods
 MethodDefined By
  
Constructor.
SeekTrait
 Inherited
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 the media is capable of seeking to the specified time.
SeekTrait
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Disposes of any resources used by this trait.
MediaTraitBase
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
  
Instructs the media to jump to the specified time.
SeekTrait
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Protected Methods
 MethodDefined By
  
Called just after the seeking property has changed.
SeekTrait
  
Called immediately before the seeking property is changed.
SeekTrait
  
Must be called by the implementing media on completing a seek.
SeekTrait
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
  Dispatched when this trait begins or ends a seek operation.SeekTrait
Property Detail

seeking

property
seeking:Boolean  [read-only]

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Indicates whether the media is currently seeking.



Implementation
    public function get seeking():Boolean

timeTrait

property 
timeTrait:org.osmf.traits:TimeTrait

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

The TimeTrait used by this SeekTrait.



Implementation
    protected function get timeTrait():org.osmf.traits:TimeTrait
    protected function set timeTrait(value:org.osmf.traits:TimeTrait):void
Constructor Detail

SeekTrait

()Constructor
public function SeekTrait(timeTrait:org.osmf.traits:TimeTrait)

Constructor.

Parameters
timeTrait:org.osmf.traits:TimeTrait
Method Detail

canSeekTo

()method
public function canSeekTo(time:Number):Boolean

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Indicates whether the media is capable of seeking to the specified time.

Parameters

time:Number — Time to seek to in seconds.

Returns
Boolean — Returns true if the media can seek to the specified time.

seek

()method 
public final function seek(time:Number):void

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Instructs the media to jump to the specified time. If a seek is attempted, dispatches a seekingChange event. If time is non numerical or negative, does not attempt to seek.

Parameters

time:Number — Time to seek to in seconds.

seekingChangeEnd

()method 
protected function seekingChangeEnd(time:Number):void

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Called just after the seeking property has changed. Dispatches the change event.

Subclasses that override should call this method to dispatch the change event.

Parameters

time:Number — New time value representing the time that the playhead seeked to.

seekingChangeStart

()method 
protected function seekingChangeStart(newSeeking:Boolean, time:Number):void

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Called immediately before the seeking property is changed.

Subclasses can override this method to communicate the change to the media.

Parameters

newSeeking:Boolean — New time value representing the time that the playhead seeks to.
 
time:Number

setSeeking

()method 
protected final function setSeeking(value:Boolean, time:Number):void

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Must be called by the implementing media on completing a seek. Calls the seekingChangeStart() and seekingChangeEnd() methods.

Parameters

value:Boolean — New seeking value.
 
time:Number — Position in seconds that the playhead was ultimately moved to.
Event Detail

seekingChange

Event
Event Object Type: org.osmf.events.SeekEvent
property SeekEvent.type = org.osmf.events.SeekEvent.SEEKING_CHANGE

Language Version: ActionScript 3.0
Product Version: OSMF 1.0
Runtime Versions: Flash Player 10, AIR 1.5

Dispatched when this trait begins or ends a seek operation.

The SeekEvent.SEEKING_CHANGE constant defines the value of the type property of the event object for a seekingChange event.