Class org.aswing.EventDispatcher

Implemented Interfaces

IEventDispatcher

Description

Field Index

ON_ACT

Method Index

new EventDispatcher()
addEventListener(), dispatchEvent(), removeEventListener()

Constructor Detail

EventDispatcher

public function EventDispatcher()

Field Detail

ON_ACT

static public ON_ACT:String
When the action performed
onActionPerformed Event{target:EventDispatcher}

Method Detail

addEventListener

public function addEventListener(eventTypeOrLis:Object, func:Function, obj:Object):Object

addEventListener(listener:Object)
addEventListener(eventName:String, func:Function, obj:Object)
addEventListener(eventName:String, func:Function)
Add a event listener, if you add event listener by the first way, add the listener of the parameter and return it. you can remove the listener later. But if you added by the last two way, the returned value is a new object of listener, so when you want to remove it, you should use the returned value.

Parameters

eventTypeOrLisit can be listener instance have the listener method, and can be a event type to indicate what type of event it want to handle.
funcif this param is not empty(undefined), the first param listener must be a String of event name.
objContext in which to run the function of param func.

Return

the listener just be added. If you add event listener by event name, the return is a new object of listener, if you add event listener by first way(a listener object), the return is IT(the first parameter).

Specified By

addEventListener() in org.aswing.IEventDispatcher

See Also

removeEventListener

public function removeEventListener(listener:Object):Void

Remove the specified event listener.

Parameters

listenerthe listener which will be removed.

Specified By

removeEventListener() in org.aswing.IEventDispatcher

dispatchEvent

public function dispatchEvent(name:Object, event:Event):Void

dispatchEvent(name:String, event:Event)
dispatchEvent(event:Event) default the the listener's method name to event's type name.

Parameters

namethe listener's method name
eventthe event object, event.target = the component object