Packageorg.as3lib.kitchensync.action
Classpublic class KSAsynchronousFunction
InheritanceKSAsynchronousFunction Inheritance KSFunction Inheritance AbstractAction Inheritance flash.events.EventDispatcher

An action for calling an asynchronous function that is expected to dipatch an event when it completes.



Public Properties
 PropertyDefined by
 InheritedautoDelete : Boolean
autoDelete is a flag that indicates whether the action should be killed when it is done executing.
AbstractAction
 Inheriteddelay : int
delay is the time that will pass after the start() method is called before the action begins.
AbstractAction
 Inheritedduration : *
KSFunction
 InheriteddurationHasElapsed : Boolean
Checks to see whether the duration of the action has elapsed and if the _startTime is defined.
AbstractAction
 Inheritedfunc : Function
The function that will be called by the action.
KSFunction
 InheritedisInstantaneous : Boolean
Returns true if the action will occur instantaneously when started
AbstractAction
 InheritedisPaused : Boolean
Will return true if the action is paused (after pause() has been called).
AbstractAction
 InheritedisRunning : Boolean
The human-readable name of this action.
AbstractAction
 Inheritedoffset : int
legacy accessors.
AbstractAction
 InheritedpauseTime : Timestamp
The time at which the action was last paused.
AbstractAction
 Inheritedresult : *
The result of the function (if the function generates one.
KSFunction
 InheritedstartTime : Timestamp
The time at which the action was last started.
AbstractAction
 InheritedstartTimeHasElapsed : Boolean
Checks to see whether the start time delay has elapsed and if the _startTime is defined.
AbstractAction
 Inheritedsync : Boolean
Setting sync to true will cause the action to sync up with real time even if framerate drops.
AbstractAction
 InheritedtimeStringParser : ITimeStringParser
[static] The timeStringParser will determine how strings are parsed into valid time values.
AbstractAction
Protected Properties
 PropertyDefined by
 Inherited_args : Array
Arguments that will be passed into the function.
KSFunction
 Inherited_autoDelete : Boolean
AbstractAction
  _completeEventDispatcher : IEventDispatcher
a reference to the event dispatcher
KSAsynchronousFunction
  _completeEventType : String
the type of event to listen for
KSAsynchronousFunction
 Inherited_delay : int = 0
AbstractAction
 Inherited_duration : int = 0
AbstractAction
 Inherited_func : Function
KSFunction
 Inherited_paused : Boolean = false
AbstractAction
 Inherited_pauseTime : Timestamp
AbstractAction
 Inherited_result : *
KSFunction
 Inherited_running : Boolean = false
AbstractAction
 Inherited_startTime : Timestamp
AbstractAction
 Inherited_sync : Boolean
AbstractAction
Public Methods
 MethodDefined by
  
KSAsynchronousFunction(delay:*, func:Function, completeEventDispatcher:IEventDispatcher, completeEventType:String, ... args)
Constructor.
KSAsynchronousFunction
 Inherited
addEventTrigger(dispatcher:IEventDispatcher, eventType:String):void
Causes the action to start playing when a specified event is fired.
AbstractAction
 Inherited
addTrigger(trigger:IAction):void
Causes the action to start playing when another event completes.
AbstractAction
  
KSAsynchronousFunction
 Inherited
invoke():*
Calls the function with the arguments specified.
KSFunction
  
kill():void
KSAsynchronousFunction
 Inherited
pause():void
Causes the action to be paused.
AbstractAction
 Inherited
register():void
Adds the action as a listener to the Synchronizer's update event.
AbstractAction
 Inherited
removeEventTrigger(dispatcher:IEventDispatcher, eventType:String):void
Removes an event trigger added by addEventTrigger().
AbstractAction
 Inherited
removeTrigger(trigger:IAction):void
Removes a trigger added with addTrigger().
AbstractAction
 Inherited
Starts the timer for this action.
AbstractAction
 Inherited
stop():void
Stops the action from running and resets the timer.
AbstractAction
 Inherited
unpause():void
Resumes the action at the point where it was paused.
AbstractAction
 Inherited
unregister():void
Removes the action as a listener to the Synchronizer's update event.
AbstractAction
  
update(currentTimestamp:Timestamp):void
Executes the function when the delay has elapsed.
KSAsynchronousFunction
Protected Methods
 MethodDefined by
 Inherited
complete():void
Call this when the action has completed.
AbstractAction
 Inherited
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
 Inherited
onTrigger(event:Event):void
Handler that starts playing the action that is called by a trigger event.
AbstractAction
Events
 EventSummaryDefined by
 Inherited  AbstractAction
 Inherited  AbstractAction
 Inherited  AbstractAction
 Inherited  AbstractAction
Property detail
_completeEventDispatcherproperty
protected var _completeEventDispatcher:IEventDispatcher

a reference to the event dispatcher

_completeEventTypeproperty 
protected var _completeEventType:String

the type of event to listen for

Constructor detail
KSAsynchronousFunction()constructor
public function KSAsynchronousFunction(delay:*, func:Function, completeEventDispatcher:IEventDispatcher, completeEventType:String, ... args)

Constructor.

Parameters
delay:* — 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.
Method detail
clone()method
public override function clone():IAction

Returns
IAction
kill()method 
public override function kill():void
onFunctionComplete()method 
protected function onFunctionComplete(event:Event):void

Event listener that is called when the asyncronous function is completed.

Parameters
event:Event
update()method 
public override function update(currentTimestamp:Timestamp):void

Executes the function when the delay has elapsed.

Parameters
currentTimestamp:Timestamp