Package | starling.animation |
Class | public class DelayedCall |
Inheritance | DelayedCall EventDispatcher Object |
Implements | IAnimatable |
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
Property | Defined By | ||
---|---|---|---|
arguments : Array [read-only] The arguments that the callback will be executed with. | DelayedCall | ||
callback : Function [read-only] The callback that will be executed when the time is up. | DelayedCall | ||
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 |
Method | Defined By | ||
---|---|---|---|
DelayedCall(callback: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 | ||
complete():void Advances the delayed call so that it is executed right away. | 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, listener:Function = null):Boolean If called with one argument, figures out if there are any listeners registered for
the given 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(callback:Function, delay:Number, args:Array = null):DelayedCall Resets the delayed call to its default values, which is useful for pooling. | DelayedCall |
arguments | property |
arguments:Array
[read-only] The arguments that the callback will be executed with. Beware: not a copy, but the actual object!
public function get arguments():Array
callback | property |
callback:Function
[read-only] The callback that will be executed when the time is up.
public function get callback():Function
currentTime | property |
currentTime:Number
[read-only] The time that has already passed (in seconds).
public function get currentTime():Number
isComplete | property |
isComplete:Boolean
[read-only] Indicates if enough time has passed, and the call has already been executed.
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
.
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).
public function get totalTime():Number
DelayedCall | () | Constructor |
public function DelayedCall(callback:Function, delay:Number, args:Array = null)
Creates a delayed call.
Parameterscallback:Function | |
delay:Number | |
args:Array (default = null )
|
advanceTime | () | method |
public function advanceTime(time:Number):void
Advance the time by a number of seconds.
Parameters
time:Number — in seconds. |
complete | () | method |
public function complete():void
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.
reset | () | method |
public function reset(callback:Function, delay:Number, args:Array = null):DelayedCall
Resets the delayed call to its default values, which is useful for pooling.
Parameters
callback:Function | |
delay:Number | |
args:Array (default = null )
|
DelayedCall |