CLICK HERE TO COPY
Actionscript:
var connect:Function = function(xp:Number, yp:Number, col:uint=0):Function{
graphics.lineStyle(0,col);
graphics.moveTo(xp, yp);
var line:Function = function(xp:Number, yp:Number):Function{
graphics.lineTo(xp, yp);
return line;
}
return line;
}
// draw a triangle
connect(200,100)(300,300)(100,300)(200, 100);
// draw a box
connect(100,100, 0xFF0000)(150,100)(150,150)(100, 150)(100,100);
This is one of those techniques that I never really get tired [...]