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

About Functions

If objects and classes are at the heart of ActionScript, functions must lie in the brain. Functions are the organizers of ActionScript. Functions group related ActionScript statements to perform a specific task. Often, you need to write code to do a certain thing over and over again. Functions eliminate the tedium and the duplication of code by putting it in one place where you can call on it to do its job from anywhere and at any time, as many times as you need.

As you learned earlier in this chapter, the objects Adam, Betty, and Zeke can perform certain tasks, called methods. If these objects were to put on a dinner party, they could organize themselves and do the following:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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