Packageorg.as3lib.kitchensync.action
Classpublic class KSFunction
InheritanceKSFunction Inheritance AbstractAction Inheritance flash.events.EventDispatcher
SubclassesKSActionController, KSAsynchronousFunction, KSMovieClipController, KSSetProperty, KSTrace

Packages up a function to be run at a specified time or as part of a sequence. Setting _duration to anything but zero will cause the function to repeat every frame until the duration is reached.



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
  duration : *
[write-only]
KSFunction
 InheriteddurationHasElapsed : Boolean
Checks to see whether the duration of the action has elapsed and if the _startTime is defined.
AbstractAction
  func : Function
[write-only] 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
  result : *
[read-only] 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
  _args : Array
Arguments that will be passed into the function.
KSFunction
 Inherited_autoDelete : Boolean
AbstractAction
 Inherited_delay : int = 0
AbstractAction
 Inherited_duration : int = 0
AbstractAction
  _func : Function
KSFunction
 Inherited_paused : Boolean = false
AbstractAction
 Inherited_pauseTime : Timestamp
AbstractAction
  _result : *
KSFunction
 Inherited_running : Boolean = false
AbstractAction
 Inherited_startTime : Timestamp
AbstractAction
 Inherited_sync : Boolean
AbstractAction
Public Methods
 MethodDefined by
  
KSFunction(delay:*, func:Function, ... args)
Constructor.
KSFunction
 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
  
KSFunction
  
invoke():*
Calls the function with the arguments specified.
KSFunction
  
kill():void
KSFunction
 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.
KSFunction
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
 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
_argsproperty
protected var _args:Array

Arguments that will be passed into the function.

durationproperty 
duration:*  [write-only]Implementation
    public function set duration(value:*):void
_funcproperty 
protected var _func:Function
funcproperty 
func:Function  [write-only]

The function that will be called by the action.

Implementation
    public function set func(value:Function):void
_resultproperty 
protected var _result:*
resultproperty 
result:*  [read-only]

The result of the function (if the function generates one.

Implementation
    public function get result():*
Constructor detail
KSFunction()constructor
public function KSFunction(delay:*, func:Function, ... args)

Constructor.

Parameters
delay:* — - the number of frames to delay the action
 
func:Function — - the function or method to call at the specified time
 
... args — - the rest of the parameters become arguments passed to the function at the time it's called.
Method detail
clone()method
public override function clone():IAction

Returns
IAction
invoke()method 
public function invoke():*

Calls the function with the arguments specified. The result of the function is stored in the results property of the SynchronizedFunction object.

Returns
*
kill()method 
public override function kill():void
update()method 
public override function update(currentTimestamp:Timestamp):void

Executes the function when the delay has elapsed. If the duration is > 0, it will repeat until the duration has elapsed.

Parameters
currentTimestamp:Timestamp