Understanding the ActionScript Language > Creating functions |  |

Creating functions

You can define functions to execute a series of statements on passed values. Your functions can also return values. Once a function is defined, it can be called from any Timeline, including the Timeline of a loaded movie.

A well-written function can be thought of as a "black box." If it has carefully placed comments about its input, output, and purpose, a user of the function does not need to understand exactly how the function works internally.