そうかdispatchEvent()も要らないのか

ベッドに入ったら、またひらめいたので、仕方なく再エントリー。もう寝たい。

単純にこれで良かった。dispatchEvent()とかイラネ。hogeとかバカみたい。でもMouseEventもnew()で生成できるの分からなかったから。

var sprite:Sprite = new Sprite();
sprite.graphics.beginFill(0x333333);
sprite.graphics.drawRect(0, 0, 100, 20);
sprite.graphics.endFill();
addChild(sprite);

sprite.addEventListener(MouseEvent.CLICK, myMethod);

myMethod(new MouseEvent(MouseEvent.CLICK));

function myMethod(event:MouseEvent):void {
  trace(event.type);
}

もう寝る。絶対寝る。起きたらブレードランナー観に行こう。ニート万歳。