var sp:Sprite = new Sprite();
stage.addEventListener(MouseEvent.MOUSE_MOVE, drawIt);
var p:Array = new Array();
function drawIt(e:MouseEvent):void {
p.push(new Object());
p[p.length-1].x = mouseX;
p[p.length-1].y = mouseY;
if (p.length > 3) {
sp.graphics.lineStyle(1);
sp.graphics.moveTo(p[p.length-3].x, p[p.length-3].y);
sp.graphics.curveTo(p[p.length-2].x, p[p.length-2].y, p[p.length-1].x, p[p.length-1].y);
};
}
addChild(sp);
Is this the correct way to draw a smooth line between mouse movements? It kinda works, but sometimes I get weird artifacts.