Search Tutorials
The Definition of a Function A Flash 4 actionscript function is predefined and serves to perform common programming tasks and empower you to create complex scripts. The best way to think of a function is a machine which accepts inputs, processes them and gives you an output. Many functions allow you to interact with variables and their contents. For example, the function "Length" allows you to count how many characters are in a string. This may sound overly simplistic but this function, when used in a script, can be used to verify that the correct number of digits in a telephone number have been entered. This animation highlights how the Length function works! A function has several parts, the function call, the function name and the arguments. The function call is easy, it's the entire function. The function name tells the computer what to do and what arguments to look for. The arguments are the key, they are the necessary bits information that you have to provide so the computer can carry out the function. The following displays a function and it parts. ![]()
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|