package { import flash.display.Sprite; import flash.events.Event; public class animation_ch09_ShapeFlag extends Sprite { private var ball:animation_ch09_Ball; public function animation_ch09_ShapeFlag() { init(); } private function init():void { ball = new animation_ch09_Ball(); addChild(ball); ball.x = stage.stageWidth / 2; ball.y = stage.stageHeight / 2; addEventListener(Event.ENTER_FRAME, onEnterFrame); } private function onEnterFrame(event:Event):void { if(ball.hitTestPoint(mouseX, mouseY, true)) { trace("hit"); } } } }