DelayedCall

public class
loom2d.animation.DelayedCall

Description

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:
loom2d.animation.Juggler

API overview

Constructor

DelayedCall ( call: Function , delay: Number , args: Vector.<Object> = null )
Creates a delayed call

Attributes

Public attributes

currentTime: Number read-only

The time that has already passed (in seconds)

isComplete: Boolean read-only

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

repeatCount: Number

The number of times the call will be repeated

totalTime: Number read-only

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

Functions

Public functions

advanceTime ( time: Number ): Void

Advance the time by a number of seconds

reset ( call: Function , delay: Number , args: Vector.<Object> = null ): DelayedCall

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

Constructor

DelayedCall ( call: Function , delay: Number , args: Vector.<Object> = null )

Creates a delayed call.

Attributes

currentTime: Number

read-only

The time that has already passed (in seconds).

isComplete: Boolean

read-only

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

repeatCount: Number
The default value is 1

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

totalTime: Number

read-only

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

Functions

addEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Registers an event listener at a certain object.

Parameters

type: String
listener: Function


advanceTime ( time: Number ): Void

Advance the time by a number of seconds.

Parameters

time: Number


dispatchEvent ( event: Event ): Void
Inherited from EventDispatcher

Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.

Parameters

event: Event


dispatchEventWith ( type: String , bubbles: Boolean = false , data: Object = null ): Void
Inherited from EventDispatcher

Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.

Parameters

type: String
bubbles: Boolean = false
data: Object = null


getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

hasEventListener ( type: String ): Boolean
Inherited from EventDispatcher

Returns if there are listeners registered for a certain event type.

Parameters

type: String


removeEventListener ( type: String , listener: Function ): Void
Inherited from EventDispatcher

Removes an event listener from the object.

Parameters

type: String
listener: Function


removeEventListeners ( type: String = null ): Void
Inherited from EventDispatcher

Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.

Parameters

type: String = null


reset ( call: Function , delay: Number , args: Vector.<Object> = null ): DelayedCall

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

Parameters

call: Function
delay: Number
args: Vector.<Object> = null


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

: