84
Flash Lite Operators
, (comma)
Availability
Flash Lite 1.0.
Usage
expression1
,
expression2
Operands
expression1, expression2
Numbers or expressions that evaluate to numbers.
Description
Operator; evaluates
expression1
, then
expression2
, and returns the value of
expression2
.
Example
The following example uses the comma (,) operator without the parentheses
()
operator and
illustrates that the comma operator returns only the value of the first expression without the
parentheses
()
operator:
v = 0;
v = 4, 5, 6;
trace(v); // output: 4
The following example uses the comma (
,
) operator with the parentheses
()
operator and
illustrates that the comma operator returns the value of the last expression when used with the
parentheses
()
operator:
v = 0;
v = (4, 5, 6);
trace(v); // output: 6
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
1.
v = 0;
z = 0;
v = v + 4 , z++, v + 6;
trace(v); // output: 4
trace(z); // output: 1
Summary of Contents for FLASH 8-FLASH
Page 1: ...Flash Lite 1 x ActionScript Language Reference...
Page 6: ...6 Contents...
Page 46: ...46 Flash Lite Global Functions...
Page 62: ...62 Flash Lite Properties...
Page 76: ...76 Flash Lite Statements...
Page 110: ...110 Flash Lite Operators...
Page 162: ...162 Index...