Chapter 5. Writing Functions
Write a function
A function is nothing more than a reusable block of code. Functions are primarily designed to let you save development time. Rather than rewrite and retest similar code over and over, you can encapsulate the code into a function and then simply call it whenever you need its capabilities.
ActionScript includes a set of global functions to perform certain common tasks. Global functions are written into the core ActionScript code and can be accessed directly in your code.
Most often, you will need some functionality that is specific to your project. In these cases, you will need ...