What Is a Function?

   

Think of functions as the organizers of Macromedia Flash MX. They group related ActionScript statements to perform a specific task. Often you need to write code to perform certain tasks over and over again. Functions eliminate duplication of code because the code can remain in one place, and you can call on it wherever and whenever you wish. Functions are blocks of reusable code that can be passed certain parameters and will return a value. Following is an example of a function that returns the square of parameter z :

 function sqr(z) {      Return z * z; } 

   
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