事件處理顯示列表
package {
import flash.events.EventDispatcher;
public class AbstractDispatcher extends EventDispatcher {
public function AbstractDispatcher(target:IEventDispatcher = null) {
super(target);
}
}
}
要在例項上分派事件:
var dispatcher:AbstractDispatcher = new AbstractDispatcher();
dispatcher.dispatchEvent(new Event(Event.CHANGE));
要偵聽例項上的事件:
var dispatcher:AbstractDispatcher = new AbstractDispatcher();
dispatcher.addEventListener(Event.CHANGE, changeHandler);
function changeHandler(event:Event):void
{
}