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

Summary

Functions are so useful that it’s hard to imagine programming without them. It’s possible (after all, you couldn’t write functions in Flash 4), but functions mean that repeated code can be consolidated; that one block of code can behave slightly differently depending on the value of a parameter received; that values can be returned; and that you can create your own methods.

Throughout all these techniques, one thing remains consistent: The form of a function is always the same. Additional parameters will sometimes appear in the parentheses following the function name, and sometimes you’ll return values, but the form is always the same. Just like if statements and for loops, you should start every function by typing the core form (in a keyframe script), as follows:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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