Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Operators > -= (subtraction assignment) | |||
Flash Lite 1.0.
expression1-=expression2
expression1, expression2 Numbers or expressions that evaluate to numbers.
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.
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
|
|
|
|