O'Reilly logo

Macromedia® Flash® 8 ActionScript: Training from the Source by Danny Patterson, Jobe Makar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Functions

When programming, you might 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 any time 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. 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, you can feed it information and output a result—or you can do both. Functions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required