• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 18. Drawing with ActionScript > Drawing Lines and Curves

Drawing Lines and Curves

The workhorses of the drawing API are the lineTo() method, which draws straight lines, and the curveTo() method, which draws curved lines. The following points apply to both these methods:

  • Graphics that you create with the drawing API are drawn underneath manually created graphics appearing in the same movie clip.

  • Drawing methods assume a starting point (“current drawing position” or “current pen”).

  • If any parameters are missing, the method fails and the current drawing position doesn’t change.

  • Whenever you designate a point, you do so by providing an x and a y parameter. This point represents the x distance and the y distance from the registration point of the movie clip that you’re drawing in. On the root, the registration point is the upper-left corner. Otherwise, it defaults to the middle of the clip.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint