要求使用AS3.0组件工具制作直线画板,并且画板是舞台的一部分,现在能够实现绘制线条,但不是直线,怎么改可以绘制出直线呢?

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();
}