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

Chapter 5. Using Functions

Chapter 5. Using Functions

When programming, you may find yourself using the same chunks of code over and over—either by copying and pasting them or by rewriting the same lines of ActionScript. There is, however, a way to write ActionScript just once and then reuse it any time with a single action. You do this via functions, and the action by which you execute a function is a call or a function call. Functions are real time-savers—both during development and during code maintenance—because they reduce the amount of code you need to write or modify. Think of a function as a mini-program that serves a specific purpose within another application. You can use it to perform a set of specific actions, or you can feed it information and output a result—or you can do both. Functions provide a powerful and versatile way to script your project.

You will create several functions that allow you to turn a Flash-TV (a simple Flash app that acts like a TV and remote control) on and off and change its channels.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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