Chapter 5. Using Functions

When programming, you may find yourself using the same chunks of code repeatedly—either by copying and pasting them or by rewriting the same lines of ActionScript. There is a way to write ActionScript just once and reuse it anytime with a single action. You do this with functions and the action by which you execute a function is a call or a function call. Functions are real time-savers—during both development and code maintenance—because they reduce the amount of code you need to write or modify.

Using Functions

You will create several functions that allow you to turn a Flash-TV on and off and change its channels. A Flash-TV is a simple ...

Get Macromedia® Flash™ MX 2004 ActionScript: Training from the Source now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.