Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
To draw straight lines we use the lineTo( ) method, which draws a line from the current drawing pen position to a specified point (x, y). For example, the following code creates a new Sprite object and draws a line in it from (0, 0) to (25, 35):
var canvas:Shape = new Shape(); canvas.graphics.lineTo(25, 35); addChild(canvas);