EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE - () Parentheses Operator

MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE
780 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Operators 169
The following example creates an object account and initializes the properties name,
address, city, state, zip, and balance with accompanying values:
var account:Object = {name:"Macromedia, Inc.", address:"600 Townsend
Street", city:"San Francisco", state:"California", zip:"94103",
balance:"1000"};
for (i in account) {
trace("account." + i + " = " + account[i]);
}
The following example shows how array and object initializers can be nested within each
other:
var person:Object = {name:"Gina Vechio", children:["Ruby", "Chickie",
"Puppa"]};
The following example uses the information in the previous example and produces the same
result using constructor functions:
var person:Object = new Object();
person.name = "Gina Vechio";
person.children = new Array();
person.children[0] = "Ruby";
person.children[1] = "Chickie";
person.children[2] = "Puppa";
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.

Table of Contents

Related product manuals