Hai,
I want to override the dispatchEvent method while inheriting from flash.display.Sprite. Whenever an event gets dispatched now like ADDED_TO_STAGE and CLICK it will get through dispatchEvent in my theory. However there is no single trace he'll get through dispatchEvent.. so the events get dispatched internally from some where else?
public class TestSprite extends Sprite { public function TestSprite() { this.addEventListener(Event.ADDED_TO_STAGE, this.handleAddedToStage); } private function handleAddedToStage(event:Event):void { } override public function dispatchEvent(event:Event):Boolean { trace(event.type); return super.dispatchEvent(event); } }
this._sprite = new TestSprite(); this._sprite.graphics.beginFill(0x000000); this._sprite.graphics.drawRect(20, 20, 200, 200); this._sprite.graphics.endFill(); this.addChild( this._sprite );
There is no trace..