() (parentheses)
235
() (parentheses)
Availability
Flash Player 4.
Usage
(
expression1, expression2
)
function
(
parameter1,..., parameterN
)
Parameters
expression1, expression2
Numbers, strings, variables, or text.
function
The function to be performed on the contents of the parentheses.
parameter1...parameterN
A series of parameters to execute before the results are passed as
parameters to the function outside the parentheses.
Returns
Nothing.
Description
Operator; performs a grouping operation on one or more parameters, or surrounds one or more
parameters and passes them as parameters to a function outside the parentheses.
Usage 1: Controls the order in which the operators are executed 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: Surrounds one or more parameters and passes them as parameters to the function
outside the parentheses.
Example
Usage 1: The following statements illustrate the use of parentheses to control the order in which
expressions are executed. The value of each expression is displayed below each line, as follows:
trace((2 + 3) * (4 + 5));
// displays 45
trace(2 + (3 * (4 + 5)));
// displays 29
trace(2 + (3 * 4) + 5);
// displays 19
Usage 2: The following examples illustrate the use of parentheses with functions.
getDate();
invoice(item, amount);
function traceParameter(param){
trace(param);
}
traceParameter(2*2);
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...