O'Reilly logo

Understanding Flash MX 2004 ActionScript 2 by Alex Michael

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

5

Functions and Arrays

This chapter looks at our last two corners of the fundamentals of ActionScript, arrays and functions. Both concepts once understood, will revolutionize the way you build applications.

Functions

Functions are a way of packaging a block of code that performs a particular task so that it can be used by a shorthand call, eliminating the need to retype the code. Functions encapsulate code that is used repeatedly. They are invoked by “calling” the function’s name. In addition to reducing the amount of typing a programmer must do, functions generally make code more readable by replacing large blocks of complicated instructions with a simple, easy-to-digest function name. A well-written function can be used by other movies. ActionScript ...

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