Using Functions

   

Any functionbuilt-in or custom-writtencan be used by calling its name followed by parentheses. All parameters that are sent to a function must be enclosed in parentheses. If there are no parameters being sent, you would simply leave the parentheses blank. Following is an example of a function that takes the parameters userName and score :

 function scoreTally(userName, score) {      score.display = userName;      score.display = score; } 

Functions are added via the Actions toolbox in the Actions panel (see Figure 12.1).

Figure 12.1. Functions are added through the toolbox of the Actions panel.

graphics/12fig01.gif

In Normal mode, select the command evaluate from the Actions toolbox. Now fill in any parameters in the parameters pane. In Expert mode, enter the function name and any parameters to be passed directly in the script pane of the Actions panel.


   
Top


Certified Macromedia Flash MX Designer Study Guide
Certified Macromedia Flash MX Designer Study Guide
ISBN: 0321126955
EAN: 2147483647
Year: 2001
Pages: 142

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net