-= (subtraction assignment)
109
Description
Operator (arithmetic compound assignment); assigns
expression1
the value of
expression1
-
expression2
. No value is returned.
For example, the following two statements are the same:
x -= y;
x = x - y;
String expressions must be converted to numbers; otherwise, -1 is returned.
Example
Usage 1: The following example uses the
-=
operator to subtract 10 from 5 and assign the
result to the variable
x
:
x = 2;
y = 3;
x -= y
trace(x);// output: -1
Usage 2: The following example shows how strings are converted to numbers:
x = "2";
y = "5";
x -= y;
trace(x);// output: -3
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...