Packagestarling.animation
Classpublic class DelayedCall
InheritanceDelayedCall Inheritance EventDispatcher Inheritance Object
Implements IAnimatable

A DelayedCall allows you to execute a method after a certain time has passed. Since it implements the IAnimatable interface, it can be added to a juggler. In most cases, you do not have to use this class directly; the juggler class contains a method to delay calls directly.

DelayedCall dispatches an Event of type 'Event.REMOVE_FROM_JUGGLER' when it is finished, so that the juggler automatically removes it when its no longer needed.

See also

Juggler


Public Properties
 PropertyDefined By
  currentTime : Number
[read-only] The time that has already passed (in seconds).
DelayedCall
  isComplete : Boolean
[read-only] Indicates if enough time has passed, and the call has already been executed.
DelayedCall
  repeatCount : int
The number of times the call will be repeated.
DelayedCall
  totalTime : Number
[read-only] The time for which calls will be delayed (in seconds).
DelayedCall
Public Methods
 MethodDefined By
  
DelayedCall(call:Function, delay:Number, args:Array = null)
Creates a delayed call.
DelayedCall
 Inherited
addEventListener(type:String, listener:Function):void
Registers an event listener at a certain object.
EventDispatcher
  
advanceTime(time:Number):void
Advance the time by a number of seconds.
DelayedCall
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all objects that have registered listeners for its type.
EventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event with the given parameters to all objects that have registered listeners for the given type.
EventDispatcher
 Inherited
hasEventListener(type:String):Boolean
Returns if there are listeners registered for a certain event type.
EventDispatcher
 Inherited
removeEventListener(type:String, listener:Function):void
Removes an event listener from the object.
EventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all event listeners with a certain type, or all of them if type is null.
EventDispatcher
  
reset(call:Function, delay:Number, args:Array = null):DelayedCall
Resets the delayed call to its default values, which is useful for pooling.
DelayedCall
Property Detail
currentTimeproperty
currentTime:Number  [read-only]

The time that has already passed (in seconds).


Implementation
    public function get currentTime():Number
isCompleteproperty 
isComplete:Boolean  [read-only]

Indicates if enough time has passed, and the call has already been executed.


Implementation
    public function get isComplete():Boolean
repeatCountproperty 
repeatCount:int

The number of times the call will be repeated. Set to '0' to repeat indefinitely.

The default value is 1.


Implementation
    public function get repeatCount():int
    public function set repeatCount(value:int):void
totalTimeproperty 
totalTime:Number  [read-only]

The time for which calls will be delayed (in seconds).


Implementation
    public function get totalTime():Number
Constructor Detail
DelayedCall()Constructor
public function DelayedCall(call:Function, delay:Number, args:Array = null)

Creates a delayed call.

Parameters
call:Function
 
delay:Number
 
args:Array (default = null)
Method Detail
advanceTime()method
public function advanceTime(time:Number):void

Advance the time by a number of seconds.

Parameters

time:Number — in seconds.

reset()method 
public function reset(call:Function, delay:Number, args:Array = null):DelayedCall

Resets the delayed call to its default values, which is useful for pooling.

Parameters

call:Function
 
delay:Number
 
args:Array (default = null)

Returns
DelayedCall