You can define a function for any Scripting Object via the Define function option in the 'Script' tree. User defined functions are used to execute a series of statements. The function can be passed up to four arguments and return a value.
User defined functions can be called from any script in your Movie by using the Function Action.
Functions can (and should) be used to improve the modularity and readability of your code. Sections of code that are often re-used should be placed into a function.