() Parentheses Operator - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

The previous ActionScript example can also be written in the following format:
var person:Object = new Object();
person.name = "Gina Vechio";
person.children = new Array("Ruby", "Chickie", "Puppa");
See also
Object

() parentheses operator

(expression1 [, expression2])
( expression1, expression2 )
function ( parameter1,..., parameterN )
Performs a grouping operation on one or more parameters, performs sequential evaluation of
expressions, 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 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 Player 4
Operands
expression1 : Object
expression2 : Object
function : Function
parameter1...parameterN : Object
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 are executed (the value of each expression appears in the Output panel):
trace((2 + 3)*(4 + 5)); // Output: 45
- 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
Operators
183

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF