stop();
import flash.display.Shape;
import flash.events.MouseEvent;
var shape:Shape=new Shape();
mc.addChild(shape);
mc.addEventListener(MouseEvent.MOUSE_DOWN,MouseDownEvent);
mc.addEventListener(MouseEvent.MOUSE_UP,MouseUpEvent);
function MouseDownEvent(e:MouseEvent):void{
shape.graphics.moveTo(mc.mouseX,mc.mouseY);
shape.graphics.lineStyle(2,color_picker.selectedColor,1,false,LineScaleMode.NORMAL,CapsStyle.SQUARE,JointStyle.MITER,10);
mc.addEventListener(MouseEvent.MOUSE_MOVE,MouseMoveEvent);
}
function MouseUpEvent(e:MouseEvent):void{
mc.removeEventListener(MouseEvent.MOUSE_MOVE,MouseMoveEvent);
}
function MouseMoveEvent(e:MouseEvent):void{
shape.graphics.lineTo(mc.mouseX,mc.mouseY);
}
btn_clear.addEventListener(MouseEvent.CLICK,ClearShape);
function ClearShape(e:MouseEvent):void{
shape.graphics.clear();
}