GODPAPER | All Packages | All Classes | Index | Frames No Frames |
DelayedCall

Package | starling.animation
Class | public class DelayedCall
Inheritance | DelayedCall EventDispatcher 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

| Property | Defined 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
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | DelayedCall(call:Function, delay:Number, args:Array = null) Creates a delayed call. | DelayedCall
|  | 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
|  | dispatchEvent(event:Event):void Dispatches an event to all objects that have registered listeners for its type. | EventDispatcher
|  | 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
|  | hasEventListener(type:String):Boolean Returns if there are listeners registered for a certain event type. | EventDispatcher
|  | removeEventListener(type:String, listener:Function):void Removes an event listener from the object. | EventDispatcher
|  | 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

currentTime | property

`currentTime:Number` [read-only]

The time that has already passed (in seconds).

Implementation
`public function get currentTime():Number`

isComplete | property |

`isComplete:Boolean` [read-only]

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

Implementation
`public function get isComplete():Boolean`

repeatCount | property |

`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`

totalTime | property |

`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`

Thu Jan 16 2014, 01:11 PM +08:00