Packageorg.as3lib.kitchensync.action
Classpublic class KSDispatchEvent
InheritanceKSDispatchEvent Inheritance AbstractAction Inheritance flash.events.EventDispatcher

An object that causes an event to be dispatched at the time of execution. An AS3 Event can be dispatched after a delay or as part of a sequence using this class. Events are dispatched using the AS3 event dispatching system and can be sent from the SynchronizedDispatchEvent itself or from any other IEventDispatcher. The constructor can be passed either an Event object or a string for the event type. Uses weak references by default.



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 : int
duration is the length of time that the action will run.
AbstractAction
 InheriteddurationHasElapsed : Boolean
Checks to see whether the duration of the action has elapsed and if the _startTime is defined.
AbstractAction
  event : Event
The event that will be dispatched.
KSDispatchEvent
  eventType : String
[write-only] Using this will set the event to a generic Event object with type of type.
KSDispatchEvent
 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
 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
  target : IEventDispatcher
This is the IEventDispatcher that the event will be dispatched from.
KSDispatchEvent
 InheritedtimeStringParser : ITimeStringParser
[static] The timeStringParser will determine how strings are parsed into valid time values.
AbstractAction
  useWeakReferences : Boolean
Set to false if you want to keep a strong reference to the event being dispatched.
KSDispatchEvent
Protected Properties
 PropertyDefined by
 Inherited_autoDelete : Boolean
AbstractAction
 Inherited_delay : int = 0
AbstractAction
 Inherited_duration : int = 0
AbstractAction
  _event : Event
KSDispatchEvent
 Inherited_paused : Boolean = false
AbstractAction
 Inherited_pauseTime : Timestamp
AbstractAction
 Inherited_running : Boolean = false
AbstractAction
 Inherited_startTime : Timestamp
AbstractAction
 Inherited_sync : Boolean
AbstractAction
  _target : IEventDispatcher
KSDispatchEvent
  _useWeakReferences : Boolean = true
KSDispatchEvent
Public Methods
 MethodDefined by
  
KSDispatchEvent(event:*, target:IEventDispatcher, ... delay = 0, listeners:*)
Constructor.
KSDispatchEvent
  
addEventListenerToTarget(listener:Function, useCapture:Boolean = false, priority:int = 0.0):void
Allows you to add an event listener to the target that is dispatching the event.
KSDispatchEvent
 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
  
KSDispatchEvent
  
kill():void
override to clean up references to other objects.
KSDispatchEvent
 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
  
removeEventListenerFromTarget(listener:Function, useCapture:Boolean = false):void
Allows you to remove an event listener from the target that is dispatching the event.
KSDispatchEvent
 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
When the delay is reached, the event will be fired from the target.
KSDispatchEvent
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
Public Constants
 ConstantDefined by
  SELF : IEventDispatcher = null
[static]
KSDispatchEvent
Property detail
_eventproperty
protected var _event:Event
eventproperty 
event:Event  [read-write]

The event that will be dispatched.

Implementation
    public function get event():Event
    public function set event(value:Event):void
eventTypeproperty 
eventType:String  [write-only]

Using this will set the event to a generic Event object with type of type.

Implementation
    public function set eventType(value:String):void
_targetproperty 
protected var _target:IEventDispatcher
targetproperty 
target:IEventDispatcher  [read-write]

This is the IEventDispatcher that the event will be dispatched from. Default is this.

Implementation
    public function get target():IEventDispatcher
    public function set target(value:IEventDispatcher):void
_useWeakReferencesproperty 
protected var _useWeakReferences:Boolean = true
useWeakReferencesproperty 
useWeakReferences:Boolean  [read-write]

Set to false if you want to keep a strong reference to the event being dispatched. Default is true.

Implementation
    public function get useWeakReferences():Boolean
    public function set useWeakReferences(value:Boolean):void
Constructor detail
KSDispatchEvent()constructor
public function KSDispatchEvent(event:*, target:IEventDispatcher, ... delay = 0, listeners:*)

Constructor.

Parameters
event:* — - Can be either an Event object or a String. If event is an Event, that object is used. If event is a string, a new event with that type is automatically created.
 
target:IEventDispatcher — - The IEventDispatcher that will dispatch the event. The default is this.
 
... delay (default = 0) — - time to wait before execution
 
listeners:* — - Any additional objects passed in will be added as listeners (if they're functions)

Throws
— - If any objects in listeners are not of type Function.
Method detail
addEventListenerToTarget()method
public function addEventListenerToTarget(listener:Function, useCapture:Boolean = false, priority:int = 0.0):void

Allows you to add an event listener to the target that is dispatching the event. Note that useWeakReference will always be true so that the listeners don't need to be removed.

Parameters
listener:Function
 
useCapture:Boolean (default = false)
 
priority:int (default = 0.0)
clone()method 
public override function clone():IAction

Returns
IAction
kill()method 
public override function kill():void

override to clean up references to other objects.

removeEventListenerFromTarget()method 
public function removeEventListenerFromTarget(listener:Function, useCapture:Boolean = false):void

Allows you to remove an event listener from the target that is dispatching the event.

Parameters
listener:Function
 
useCapture:Boolean (default = false)
update()method 
public override function update(currentTimestamp:Timestamp):void

When the delay is reached, the event will be fired from the target. Note that if duration is > 0, this will continue to fire for every frame until duration is elapsed.

Parameters
currentTimestamp:Timestamp
Constant detail
SELFconstant
public static const SELF:IEventDispatcher = null