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
Share this Page URL
Help

Chapter 10. Objects and Dictionaries > Using Objects for Named Arguments

10.3. Using Objects for Named Arguments

As you learned in Chapter 3, "Methods and Functions," ActionScript 3.0 gives you added flexibility when passing parameters to functions. You can leave out arguments with default values, and you can accept variable-length argument lists with the ...rest parameter. Every so often it might be necessary for a function to accept more than a handful of possible arguments, in which case identifying the argument's intention from its position in the argument list alone can be a memory exercise.

For example, the following code sets a particular line style in preparation to draw some strokes on a Sprite:


  

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