MACROMEDIA FLEX-FLEX ACTIONSCRIPT LANGUAGE Reference page 164

Actionscript language reference
Table of Contents

Advertisement

Example
The following example defines the function
Math.pow(x, 2)
function sqr(x:Number) {
return Math.pow(x, 2);
}
var y:Number = sqr(3);
trace(y);
// output: 9
If the function is defined and used in the same script, the function definition may appear after
using the function:
var y:Number = sqr(3);
trace(y);
// output: 9
function sqr(x:Number) {
return Math.pow(x, 2);
}
164
Chapter 5: ActionScript Core Language Elements
of the parameter:
, which accepts one parameter and returns the
sqr

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flex

Table of Contents