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 Juggler

### Hierarchy

- EventDispatcher
  - DelayedCall

### Implements

- IAnimatable

## Index

### Constructors

- constructor

### Properties

- arguments
- callback
- currentTime
- isComplete
- repeatCount
- totalTime

### Methods

- addEventListener
- advanceTime
- complete
- dispatchEvent
- dispatchEventWith
- get_arguments
- get_callback
- get_currentTime
- get_isComplete
- get_repeatCount
- get_totalTime
- hasEventListener
- removeEventListener
- removeEventListeners
- reset
- set_repeatCount

## Constructors

### constructor

- new DelayedCall(callback: Function, delay: number, args?: Array<any>): DelayedCall

- Overrides EventDispatcher.constructor

  - Defined in lib/starling/animation/DelayedCall.d.ts:18

  Creates a delayed call.

  #### Parameters

  - ##### callback: Function

  - ##### delay: number

  - ##### Optional args: Array<any>

  #### Returns DelayedCall

## Properties

### arguments

arguments: Array<any>

- Defined in lib/starling/animation/DelayedCall.d.ts:56

The arguments that the callback will be executed with. Beware: not a copy, but the actual object!

### callback

callback: Function

- Defined in lib/starling/animation/DelayedCall.d.ts:51

The callback that will be executed when the time is up.

### currentTime

currentTime: number

- Defined in lib/starling/animation/DelayedCall.d.ts:41

The time that has already passed (in seconds).

### isComplete

isComplete: boolean

- Defined in lib/starling/animation/DelayedCall.d.ts:33

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

### repeatCount

repeatCount: number

- Defined in lib/starling/animation/DelayedCall.d.ts:46

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

### totalTime

totalTime: number

- Defined in lib/starling/animation/DelayedCall.d.ts:37

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

## Methods

### addEventListener

- addEventListener(type: string, listener: Function): void

- Inherited from EventDispatcher.addEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:32

  Registers an event listener at a certain object.

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### advanceTime

- advanceTime(time: number): void

- - Defined in lib/starling/animation/DelayedCall.d.ts:26
  inheritdoc

  #### Parameters

  - ##### time: number

  #### Returns void

### complete

- complete(): void

- - Defined in lib/starling/animation/DelayedCall.d.ts:30

  Advances the delayed call so that it is executed right away. If 'repeatCount' is anything else than '1', this method will complete only the current iteration.

  #### Returns void

### dispatchEvent

- dispatchEvent(event: Event): void

- Inherited from EventDispatcher.dispatchEvent

  - Defined in lib/starling/events/EventDispatcher.d.ts:45

  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

  #### Returns void

### dispatchEventWith

- dispatchEventWith(type: string, bubbles?: boolean, data?: any): void

- Inherited from EventDispatcher.dispatchEventWith

  - Defined in lib/starling/events/EventDispatcher.d.ts:50

  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

  - ##### Optional bubbles: boolean

  - ##### Optional data: any

  #### Returns void

### Protected get_arguments

- get_arguments(): Array<any>

- - Defined in lib/starling/animation/DelayedCall.d.ts:57

  #### Returns Array<any>

### Protected get_callback

- get_callback(): Function

- - Defined in lib/starling/animation/DelayedCall.d.ts:52

  #### Returns Function

### Protected get_currentTime

- get_currentTime(): number

- - Defined in lib/starling/animation/DelayedCall.d.ts:42

  #### Returns number

### Protected get_isComplete

- get_isComplete(): boolean

- - Defined in lib/starling/animation/DelayedCall.d.ts:34

  #### Returns boolean

### Protected get_repeatCount

- get_repeatCount(): number

- - Defined in lib/starling/animation/DelayedCall.d.ts:47

  #### Returns number

### Protected get_totalTime

- get_totalTime(): number

- - Defined in lib/starling/animation/DelayedCall.d.ts:38

  #### Returns number

### hasEventListener

- hasEventListener(type: string, listener?: any): boolean

- Inherited from EventDispatcher.hasEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:55

  If called with one argument, figures out if there are any listeners registered for the given event type. If called with two arguments, also determines if a specific listener is registered.

  #### Parameters

  - ##### type: string

  - ##### Optional listener: any

  #### Returns boolean

### removeEventListener

- removeEventListener(type: string, listener: Function): void

- Inherited from EventDispatcher.removeEventListener

  - Defined in lib/starling/events/EventDispatcher.d.ts:35

  Removes an event listener from the object.

  #### Parameters

  - ##### type: string

  - ##### listener: Function

  #### Returns void

### removeEventListeners

- removeEventListeners(type?: string): void

- Inherited from EventDispatcher.removeEventListeners

  - Defined in lib/starling/events/EventDispatcher.d.ts:39

  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

  - ##### Optional type: string

  #### Returns void

### reset

- reset(callback: Function, delay: number, args?: Array<any>): DelayedCall

- - Defined in lib/starling/animation/DelayedCall.d.ts:23

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

  #### Parameters

  - ##### callback: Function

  - ##### delay: number

  - ##### Optional args: Array<any>

  #### Returns DelayedCall

### Protected set_repeatCount

- set_repeatCount(value: number): number

- - Defined in lib/starling/animation/DelayedCall.d.ts:48

  #### Parameters

  - ##### value: number

  #### Returns number

Generated using TypeDoc