Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

25.2. Drawing Lines

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);


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial