package{ import flash.display.*; import flash.geom.*; public class Main extends Sprite{ public function Main(){ var pt:Point = new Point(20, 30); var temp:Sprite = new Sprite(); temp.graphics.beginFill(0x00ff00, 1.0); temp.graphics.drawRect(0, 0, 30, 30); temp.graphics.endFill(); addChild(temp); if (temp.hitTestPoint(pt.x, pt.y)) { trace("Point within bounds"); } } }}
Name (required)
email (will not be published) (required)
Website