Packagesystem.process
Classpublic class EventDispatcherTask
InheritanceEventDispatcherTask Inheritance Task Inheritance Object

A process who dispatch events with a specific EventDispatcher object.

Example :

     package examples
     {
         import system.process.Action;
         import system.process.EventDispatcherTask;
         
         import flash.display.Sprite;
         import flash.events.Event;
         import flash.events.EventDispatcher;
         
         public class EventDispatcherTaskExample extends Sprite
         {
             public function EventDispatcherTaskExample()
             {
                 var dispatcher:EventDispatcher = new EventDispatcher() ;
                 var event:Event                = new Event("action") ;
                 
                 process.addEventListener( "action" , debug ) ;
                 
                 var process:EventDispatcherTask = new EventDispatcherTask( dispatcher , event ) ;
                 
                 process.finishIt.connect( finish ) ;
                 process.start.connect( start ) ;
                 
                 process.run() ;
             }
             
             public function debug( e:Event ):void
             {
                 trace( e.type ) ;
             }
             
             public function finish( action:Action ):void
             {
                 trace( "finish" ) ;
             }
             
             public function start( action:Action ):void
             {
                 trace( "start" ) ;
             }
         }
     }
     



Public Properties
 PropertyDefined By
  dispatcher : EventDispatcher
The EventDispatcher reference.
EventDispatcherTask
  event : Event
The event to dispatch in this process.
EventDispatcherTask
 InheritedfinishIt : Signaler
This signal emit when the notifyFinished method is invoked.
Task
 Inheritedlogger : Logger
Determinates the internal Logger reference of this Loggable object.
Task
 Inheritedphase : String
[read-only] The current phase of the action.
Task
 Inheritedrunning : Boolean
[read-only] Indicates true if the process is in progress.
Task
 InheritedstartIt : Signaler
This signal emit when the notifyStarted method is invoked.
Task
  verbose : Boolean
Switch the verbose mode of the task.
EventDispatcherTask
Public Methods
 MethodDefined By
  
EventDispatcherTask(dispatcher:EventDispatcher = null, event:* = null, verbose:Boolean = false)
Creates a new EventDispatcherTask instance.
EventDispatcherTask
  
clone():*
[override] Returns a shallow copy of this object.
EventDispatcherTask
 Inherited
isLocked():Boolean
Returns true if the object is locked.
Task
 Inherited
lock():void
Locks the object.
Task
 Inherited
Notify an ActionEvent when the process is finished.
Task
 Inherited
Notify an ActionEvent when the process is started.
Task
  
run(... arguments):void
[override] Run the process.
EventDispatcherTask
 Inherited
unlock():void
Unlocks the display.
Task
Protected Methods
 MethodDefined By
 Inherited
setRunning(b:Boolean):void
Changes the running property value.
Task
Property Detail
dispatcherproperty
public var dispatcher:EventDispatcher

The EventDispatcher reference.

eventproperty 
public var event:Event

The event to dispatch in this process.

verboseproperty 
public var verbose:Boolean

Switch the verbose mode of the task.

Constructor Detail
EventDispatcherTask()Constructor
public function EventDispatcherTask(dispatcher:EventDispatcher = null, event:* = null, verbose:Boolean = false)

Creates a new EventDispatcherTask instance.

Parameters
dispatcher:EventDispatcher (default = null) — The EventDispatcher reference.
 
event:* (default = null) — The event to dispatch.
 
verbose:Boolean (default = false) — Switch the verbose mode of the task.
Method Detail
clone()method
override public function clone():*

Returns a shallow copy of this object.

Returns
* — a shallow copy of this object.
run()method 
override public function run(... arguments):void

Run the process.

Parameters

... arguments