I wanted to capture a solid coordinate path using mouse positions with the MOUSE_MOVE event, and setPixels.
drawCircle() is for proof of concept, you wouldn’t want to draw with interpolated points where lineTo, or other Graphic methods were available.
var p1:Point = new Point(30, 40);
var p2:Point = new Point(400, 350);
spr1.graphics.moveTo(p1.x, p1.y);
spr1.graphics.lineStyle(20, 0×111111, 1, true, LineScaleMode.NORMAL, CapsStyle.ROUND, JointStyle.ROUND, 10);
spr1.graphics.lineTo(p2.x, p2.y);
spr2.graphics.moveTo(p1.x, p1.y);
var iPoints:Array = interpolationPoints(p1, p2);
var numPoints:Number = iPoints.length;
var interpolation:Point;
spr2.graphics.beginFill(0×111111, 1);
for(var i:int=0;i< numPoints;i++)
{
interpolation = iPoints[i];
spr2.graphics.drawCircle(interpolation.x, interpolation.y, 10);
}
spr2.graphics.endFill();
function interpolationPoints(p1:Point, p2:Point):Array
{
var arr:Array = [];
var distance:Number = Point.distance(p1, p2);
var percent:Number;
for(var i:int=0;i<distance;i++)
{
percent = i/distance;
arr.push(Point.interpolate(p1, p2, percent));
}
return arr;
}



