User Guide

154 ActionScript language elements
The following example uses the comma (,) operator without the parentheses () operator and
illustrates that the comma operator sequentially evaluates all of the expressions but returns the
value of the first expression. The second expression,
z++, is evaluated and z is incremented by
one.
var v:Number = 0;
var z:Number = 0;
v = v + 4 , z++, v + 6;
trace(v); // output: 4
trace(z); // output: 1
The following example is identical to the previous example except for the addition of the
parentheses () operator and illustrates once again that, when used with the parentheses ()
operator, the comma (,) operator returns the value of the last expression in the series:
var v:Number = 0;
var z:Number = 0;
v = (v + 4, z++, v + 6);
trace(v); // output: 6
trace(z); // output: 1
See also
() parentheses operator
add concatenation (strings) operator
string1 add string2
Deprecated since Flash Player 5. Macromedia recommends that you use the add (+) operator
when creating content for Flash Player 5 or later. This operator is not supported in Flash
Player 8 or later.
Concatenates two or more strings. The add (+) operator replaces the Flash 4
& operator; Flash
Player 4 files that use the
& operator are automatically converted to use the add (+) operator
for string concatenation when brought into the Flash 5 or later authoring environment. Use
the add (+) operator to concatenate strings if you are creating content for Flash Player 4 or
earlier versions of the Player.
Availability: ActionScript 1.0; Flash Player 4
Operands
string1 : String - A string.
string2 : String - A string.