| Package | org.as3lib.kitchensync.action |
| Class | public class KSAsynchronousFunction |
| Inheritance | KSAsynchronousFunction |
| Property | Defined by | ||
|---|---|---|---|
| _args : Array
Arguments that will be passed into the function.
| KSFunction | ||
| _autoDelete : Boolean | AbstractAction | ||
| _completeEventDispatcher : IEventDispatcher a reference to the event dispatcher
| KSAsynchronousFunction | ||
| _completeEventType : String the type of event to listen for
| KSAsynchronousFunction | ||
| _delay : int = 0 | AbstractAction | ||
| _duration : int = 0 | AbstractAction | ||
| _func : Function | KSFunction | ||
| _paused : Boolean = false | AbstractAction | ||
| _pauseTime : Timestamp | AbstractAction | ||
| _result : * | KSFunction | ||
| _running : Boolean = false | AbstractAction | ||
| _startTime : Timestamp | AbstractAction | ||
| _sync : Boolean | AbstractAction | ||
| Method | Defined by | ||
|---|---|---|---|
|
KSAsynchronousFunction(delay:*, func:Function, completeEventDispatcher:IEventDispatcher, completeEventType:String, ... args)
Constructor.
| KSAsynchronousFunction | ||
|
addEventTrigger(dispatcher:IEventDispatcher, eventType:String):void
Causes the action to start playing when a specified event is fired.
| AbstractAction | ||
|
addTrigger(trigger:IAction):void
Causes the action to start playing when another event completes.
| AbstractAction | ||
| KSAsynchronousFunction | |||
|
invoke():*
Calls the function with the arguments specified.
| KSFunction | ||
|
kill():void
| KSAsynchronousFunction | ||
|
pause():void
Causes the action to be paused.
| AbstractAction | ||
|
register():void
Adds the action as a listener to the Synchronizer's update event.
| AbstractAction | ||
|
removeEventTrigger(dispatcher:IEventDispatcher, eventType:String):void
Removes an event trigger added by addEventTrigger().
| AbstractAction | ||
|
removeTrigger(trigger:IAction):void
Removes a trigger added with addTrigger().
| AbstractAction | ||
|
Starts the timer for this action.
| AbstractAction | ||
|
stop():void
Stops the action from running and resets the timer.
| AbstractAction | ||
|
unpause():void
Resumes the action at the point where it was paused.
| AbstractAction | ||
|
unregister():void
Removes the action as a listener to the Synchronizer's update event.
| AbstractAction | ||
|
Executes the function when the delay has elapsed.
| KSAsynchronousFunction | ||
| Method | Defined by | ||
|---|---|---|---|
|
complete():void
Call this when the action has completed.
| AbstractAction | ||
|
forceUpdate():void
Foreces the update() method to fire without being triggered by Synchronizer.
| AbstractAction | ||
|
onFunctionComplete(event:Event):void
Event listener that is called when the asyncronous function is completed.
| KSAsynchronousFunction | ||
|
onTrigger(event:Event):void
Handler that starts playing the action that is called by a trigger event.
| AbstractAction | ||
| _completeEventDispatcher | property |
protected var _completeEventDispatcher:IEventDispatchera reference to the event dispatcher
| _completeEventType | property |
protected var _completeEventType:Stringthe type of event to listen for
| KSAsynchronousFunction | () | constructor |
public function KSAsynchronousFunction(delay:*, func:Function, completeEventDispatcher:IEventDispatcher, completeEventType:String, ... args)Constructor.
Parametersdelay:* — The time to wait before calling the function.
|
|
func:Function — The function to call
|
|
completeEventDispatcher:IEventDispatcher — The IEventDispatcher that will fire the event signaling that the
function is complete.
|
|
completeEventType:String — The type (name) of the event that will be fired when complete.
|
|
... args — All additional parameters will be passed as arguments to the function when it is called.
|
| clone | () | method |
| kill | () | method |
public override function kill():void
| onFunctionComplete | () | method |
protected function onFunctionComplete(event:Event):voidEvent listener that is called when the asyncronous function is completed.
Parametersevent:Event |
| update | () | method |
public override function update(currentTimestamp:Timestamp):voidExecutes the function when the delay has elapsed.
ParameterscurrentTimestamp:Timestamp |