Packageorg.as3lib.kitchensync.action
Classpublic class AbstractAction
InheritanceAbstractAction Inheritance flash.events.EventDispatcher
ImplementsIAction
SubclassesAbstractActionGroup, KSDispatchEvent, KSFunction, KSSoundController, KSTween, KSWait

This can be any action that takes place at a specifity time and uses the Synchronizer class to coordinate timing.



Public Properties
 PropertyDefined by
  autoDelete : Boolean
autoDelete is a flag that indicates whether the action should be killed when it is done executing.
AbstractAction
  delay : int
delay is the time that will pass after the start() method is called before the action begins.
AbstractAction
  duration : int
duration is the length of time that the action will run.
AbstractAction
  durationHasElapsed : Boolean
[read-only] Checks to see whether the duration of the action has elapsed and if the _startTime is defined.
AbstractAction
  isInstantaneous : Boolean
[read-only] Returns true if the action will occur instantaneously when started
AbstractAction
  isPaused : Boolean
[read-only] Will return true if the action is paused (after pause() has been called).
AbstractAction
  isRunning : Boolean
[read-only] The human-readable name of this action.
AbstractAction
  offset : int
legacy accessors.
AbstractAction
  pauseTime : Timestamp
[read-only] The time at which the action was last paused.
AbstractAction
  startTime : Timestamp
[read-only] The time at which the action was last started.
AbstractAction
  startTimeHasElapsed : Boolean
[read-only] Checks to see whether the start time delay has elapsed and if the _startTime is defined.
AbstractAction
  sync : Boolean
Setting sync to true will cause the action to sync up with real time even if framerate drops.
AbstractAction
  timeStringParser : ITimeStringParser
[static] The timeStringParser will determine how strings are parsed into valid time values.
AbstractAction
Protected Properties
 PropertyDefined by
  _autoDelete : Boolean
AbstractAction
  _delay : int = 0
AbstractAction
  _duration : int = 0
AbstractAction
  _paused : Boolean = false
AbstractAction
  _pauseTime : Timestamp
AbstractAction
  _running : Boolean = false
AbstractAction
  _startTime : Timestamp
AbstractAction
  _sync : Boolean
AbstractAction
Public Methods
 MethodDefined by
  
Constructor.
AbstractAction
  
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
  
Creates a copy of the object with all the property values of the original and returns it.
AbstractAction
  
kill():void
Unregisters the function and removes any refrerences to objects that it may be holding onto.
AbstractAction
  
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
  
update(currentTimestamp:Timestamp):void
This function will be registered by the register method to respond to update events from the synchronizer.
AbstractAction
Protected Methods
 MethodDefined 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
  
onTrigger(event:Event):void
Handler that starts playing the action that is called by a trigger event.
AbstractAction
Events
 EventSummaryDefined by
    AbstractAction
    AbstractAction
    AbstractAction
    AbstractAction
Property detail
_autoDeleteproperty
protected var _autoDelete:Boolean
autoDeleteproperty 
autoDelete:Boolean  [read-write]

autoDelete is a flag that indicates whether the action should be killed when it is done executing. The default is set to false so the actions must be deleted manually.

Implementation
    public function get autoDelete():Boolean
    public function set autoDelete(value:Boolean):void
_delayproperty 
protected var _delay:int = 0
delayproperty 
delay:int  [read-write]

delay is the time that will pass after the start() method is called before the action begins. Will accept an integer or a parsable string.

Implementation
    public function get delay():int
    public function set delay(value:int):void

See also

org.as3lib.kitchensync.ITimeStringParser
_durationproperty 
protected var _duration:int = 0
durationproperty 
duration:int  [read-write]

duration is the length of time that the action will run. Will accept an integer or a parsable string.

Implementation
    public function get duration():int
    public function set duration(value:int):void

See also

org.as3lib.kitchensync.ITimeStringParser
timeUnit
durationHasElapsedproperty 
durationHasElapsed:Boolean  [read-only]

Checks to see whether the duration of the action has elapsed and if the _startTime is defined. In other words, checks to see whether the action is finished executing.

Implementation
    public function get durationHasElapsed():Boolean
isInstantaneousproperty 
isInstantaneous:Boolean  [read-only]

Returns true if the action will occur instantaneously when started

Implementation
    public function get isInstantaneous():Boolean
isPausedproperty 
isPaused:Boolean  [read-only]

Will return true if the action is paused (after pause() has been called). Calling unpause() or stop() will return the value to false.

Implementation
    public function get isPaused():Boolean
isRunningproperty 
isRunning:Boolean  [read-only]

The human-readable name of this action. public function get name():String { return _name; } public function set name(name:String):void { _name = name; } protected var _name:String;

Implementation
    public function get isRunning():Boolean
offsetproperty 
offset:int  [read-write]

legacy accessors. synonomous with delay.

Implementation
    public function get offset():int
    public function set offset(value:int):void
_pausedproperty 
protected var _paused:Boolean = false
_pauseTimeproperty 
protected var _pauseTime:Timestamp
pauseTimeproperty 
pauseTime:Timestamp  [read-only]

The time at which the action was last paused.

Implementation
    public function get pauseTime():Timestamp
_runningproperty 
protected var _running:Boolean = false
_startTimeproperty 
protected var _startTime:Timestamp
startTimeproperty 
startTime:Timestamp  [read-only]

The time at which the action was last started.

Implementation
    public function get startTime():Timestamp
startTimeHasElapsedproperty 
startTimeHasElapsed:Boolean  [read-only]

Checks to see whether the start time delay has elapsed and if the _startTime is defined. In other words, checks to see whether the action is ready to execute. Duration is handled seperately.

Implementation
    public function get startTimeHasElapsed():Boolean
_syncproperty 
protected var _sync:Boolean
syncproperty 
sync:Boolean  [read-write]

Setting sync to true will cause the action to sync up with real time even if framerate drops. Otherwise, the action will be synced to frames.

Implementation
    public function get sync():Boolean
    public function set sync(value:Boolean):void
timeStringParserproperty 
public static var timeStringParser:ITimeStringParser

The timeStringParser will determine how strings are parsed into valid time values.

See also

org.as3lib.kitchensync.ITimeStringParser
org.as3lib.kitchensync.TimeStringParser_en
Constructor detail
AbstractAction()constructor
public function AbstractAction()

Constructor.

Method detail
addEventTrigger()method
public function addEventTrigger(dispatcher:IEventDispatcher, eventType:String):void

Causes the action to start playing when a specified event is fired.

Parameters
dispatcher:IEventDispatcher — The object that will dispatch the event.
 
eventType:String — The event type to listen for.
addTrigger()method 
public function addTrigger(trigger:IAction):void

Causes the action to start playing when another event completes.

Parameters
trigger:IAction — Another action that will trigger the start of this action.

Throws
— If the trigger action is the same as this action.
clone()method 
public function clone():IAction

Creates a copy of the object with all the property values of the original and returns it. This method should be overrided by child classes to ensure that all properties are copied.

Returns
IAction
complete()method 
protected function complete():void

Call this when the action has completed.

forceUpdate()method 
protected function forceUpdate():void

Foreces the update() method to fire without being triggered by Synchronizer.

See also

kill()method 
public function kill():void

Unregisters the function and removes any refrerences to objects that it may be holding onto. Subclass this function to remove references to objects used by the action.

onTrigger()method 
protected function onTrigger(event:Event):void

Handler that starts playing the action that is called by a trigger event.

Parameters
event:Event

See also

pause()method 
public function pause():void

Causes the action to be paused. The action temporarily ignores update events from the Synchronizer and the onUpdate() handler will not be called. When unpause() is called, the action will continue at the point where it was paused. If the pause() method affects the start time even if the delay time hasn't expired yet.

register()method 
public function register():void

Adds the action as a listener to the Synchronizer's update event.

removeEventTrigger()method 
public function removeEventTrigger(dispatcher:IEventDispatcher, eventType:String):void

Removes an event trigger added by addEventTrigger().

Parameters
dispatcher:IEventDispatcher — The event dispatcher to remove.
 
eventType:String — The event type to listen for.
removeTrigger()method 
public function removeTrigger(trigger:IAction):void

Removes a trigger added with addTrigger().

Parameters
trigger:IAction — Another action that triggers the start of this action.
start()method 
public function start():IAction

Starts the timer for this action. Registers the action with the synchronizer.

Returns
IAction

Throws
— - if the method is called while the action is already running.
stop()method 
public function stop():void

Stops the action from running and resets the timer.

unpause()method 
public function unpause():void

Resumes the action at the point where it was paused.

unregister()method 
public function unregister():void

Removes the action as a listener to the Synchronizer's update event.

update()method 
public function update(currentTimestamp:Timestamp):void

This function will be registered by the register method to respond to update events from the synchronizer. Code that performs the action associated with this object should go in this function. This function must be implemented by the subclass. The internal allows certain other classes such as the AbstractSynchronizedGroup to force an update of its children.

Parameters
currentTimestamp:Timestamp — The current timestamp from the Synchronizer.
Event detail
actionCompleteevent 
Event object type: org.as3lib.kitchensync.KitchenSyncEvent

actionPauseevent  
Event object type: org.as3lib.kitchensync.KitchenSyncEvent

actionStartevent  
Event object type: org.as3lib.kitchensync.KitchenSyncEvent

actionUnpauseevent  
Event object type: org.as3lib.kitchensync.KitchenSyncEvent