MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 170

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Usage 1: Controls the order in which the operators execute in the expression. Parentheses
override the normal precedence order and cause the expressions within the parentheses to be
evaluated first. When parentheses are nested, the contents of the innermost parentheses are
evaluated before the contents of the outer ones.
Usage 2: Evaluates a series of expressions, separated by commas, in sequence, and returns the
result of the final expression.
Usage 3: Surrounds one or more parameters and passes them as parameters to the function
outside the parentheses.
Availability: ActionScript 1.0; Flash Lite 1.0
Operands
expression1 :
Object
expression2 :
Object
function :
Function
parameter1...parameterN :
are passed as parameters to the function outside the parentheses.
Example
Usage 1: The following statements show the use of parentheses to control the order in which
expressions a re executed (the value of each expression appears in the Output panel):
trace((2 + 3)*(4 + 5)); // displays 45 trace((2 + 3) * (4 + 5)); // writes
45 trace(2 + (3 * (4 + 5))); // // displays 29 trace(2 + (3 * (4 + 5)));
// // writes 29 trace(2+(3*4)+5); // displays 19 trace(2 + (3 * 4) + 5);
// writes 19
Usage 2: The following example evaluates the function
and returns the result of the expression
var a:Number = 1;
var b:Number = 2;
function foo() { a += b; }
function bar() { b *= 10; }
trace((foo(), bar(), a + b)); // outputs 23
Usage 3: The following example shows the use of parentheses with functions:
var today:Date = new Date();
trace(today.getFullYear()); // traces current year
function traceParameter(param):Void { trace(param); }
traceParameter(2 * 2); //traces 4
170
ActionScript language elements
- Numbers, strings, variables, or text.
- Numbers, strings, variables, or text.
- The function to be performed on the contents of the parentheses.
- A series of parameters to execute before the results
Object
a + b
, and then the function
foo()
:
,
bar()

Advertisement

Table of Contents
loading

Table of Contents