IEventDispatcher接口定义五个方法,如以下代码中所示: package flash.events { public interface IEventDispatcher { function addEventListener(eventName:String,listener:Object,useCapture:Boolean=false,priority:Integer=0,useWeakReference:Boolean=false):Boolean; function removeEventListener(eventName:String,listener:Object,useCapture:Boolean=false):Boolean; function dispatchEvent(eventObject:Event):Boolean; function hasEventListener(eventName:String):Boolean; function willTrigger(eventName:String):Boolean; } }
Flash Player API使用EventDispatcher类来实现IEventDispatcher接口,该类用作可以是事件目标或事件流一部分的所有类的基类。DisplayObject类继承自EventDispatcher类。这意味着,显示列表中的所有对象都可以访问IEventDispatcher接口的方法。