package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.Event;
public class Main extends Sprite
{
public function Main()
{
//マウスイベントを登録
this.stage.addEventListener(MouseEvent.CLICK, onClick);
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, onMove);
}
private function onMove(e:MouseEvent):void
{
//マウスの移動先に青い丸を書く
this.graphics.lineStyle(1, 0x0000FF);
this.graphics.drawCircle(e.stageX,e.stageY,1);
}
private function onClick(e:MouseEvent):void
{
//マウスクリック位置に赤い丸を書く
this.graphics.lineStyle(3, 0xFF0000);
this.graphics.drawCircle(e.stageX,e.stageY,3);
}
}
}
その他のマウスイベント
http://livedocs.adobe.com/flash/9.0_jp/ActionScriptLangRefV3/flash/events/MouseEvent.html