I see @john sharing a code to make a line with two points like this:

private function createLine(fromX:Number, fromY:Number, toX:Number, toY:Number, thickness:Number):Polygon { var len:Number, fXOffset:Number, fYOffset:Number; fXOffset = toX - fromX; fYOffset = toY - fromY; len = Math.sqrt(fXOffset * fXOffset + fYOffset * fYOffset); fXOffset = fXOffset * thickness / (len * 2); fYOffset = fYOffset * thickness / (len * 2); return new Polygon ([ fromX + fYOffset, fromY - fXOffset, toX + fYOffset, toY - fXOffset, toX - fYOffset, toY + fXOffset, fromX - fYOffset, fromY + fXOffset ]); }

if I want to make a line using polygons and array = [(x, y), ...] are there any references that I can follow?