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 { }