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 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 ...