Game Development Reference
In-Depth Information
import flash.events.Event;
import flash.geom.Rectangle;
public class RectangleDispatcher extends Rectangle
implements IEventDispatcher {
private var _dispatcher:EventDispatcher;
public function RectangleDispatcher() {
_dispatcher = new EventDispatcher(this);
}
override public function set width(value:Number) {
super.width = value;
dispatchEvent(new Event(Event.CHANGE));
}
override public function set height(value:Number) {
super.height = value;
dispatchEvent(new Event(Event.CHANGE));
}
public function addEventListener(type:String,
listener:Function, useCapture:Boolean=false,
priority:int=0,useWeakReference:Boolean =
false):void {
_dispatcher.addEventListener(type, listener,
useCapture, priority, useWeakReference);
}
public function removeEventListener(type:String,
listener:Function, useCapture:Boolean=false):void {
_dispatcher.removeEventListener(type,
listener, useCapture);
}
public function dispatchEvent(event:Event):Boolean{
_dispatcher.dispatchEvent(event);
}
public function hasEventListener(type:String):Boolean{
return _dispatcher.hasEventListener(type);
}
public function willTrigger(type:String):Boolean{
return _dispatcher.willTrigger(type);
}
}
}
Search Nedrilad ::




Custom Search