IEventDispatcher
static public ON_ACT:String
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.
eventTypeOrLis | it can be listener instance have the listener method, and can be a event type to indicate what type of event it want to handle. |
func | if this param is not empty(undefined), the first param listener must be a String of event name. |
obj | Context in which to run the function of param func. |
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).
addEventListener() in org.aswing.IEventDispatcher
public function removeEventListener(listener:Object):Void
Remove the specified event listener.
listener | the listener which will be removed. |
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.
name | the listener's method name |
event | the event object, event.target = the component object |