How to draw a line with finger and detect if it's in the area ?
I've got an image on my AIR app where the user have to draw a line with his finger on it. The purpose is to draw the line somewhere quite precise.
So, to draw a line, here's what I did :
var drawingLine:MovieClip = new MovieClip();
addChildAt(drawingLine,0);stage.addEventListener(MouseEvent.MOUSE_DOWN, MouseDown);
stage.addEventListener(MouseEvent.MOUSE_UP, MouseUp);function MouseDown(event:MouseEvent):void{
drawingLine.graphics.lineStyle(3);
drawingLine.graphics.moveTo(mouseX, mouseY);
stage.addEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
}function MouseMove(event:MouseEvent):void{
drawingLine.graphics.lineTo(mouseX, mouseY);
}function MouseUp(event:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE, MouseMove);
}
So, now, how can I determine an area and check if the user has draw his lines in the area ? The line should be inside the area completely. If possible, of course.
I thought about using hitTestObject but I don't think that's the good way to do it.
