![]() ![]() | |
Flash Player 4.
expression1-=expression2
expression1,expression2 A number or expression that evaluates to a number.
Nothing.
Operator (arithmetic compound assignment); assigns expression1 the value of expression1 - expression2. For example, the following two statements are the same:
x -= y;x = x - y;
String expressions must be converted to numbers; otherwise, NaN is returned.
Usage 1: The following example uses the -= operator to subtract 10 from 5 and assign the result to the variable x.
x = 5;y = 10;x -= ytrace(x); //returns-5
Usage 2: The following example shows how strings are converted to numbers.
x = "5"; y = "10"; x -= y; trace(x); // returns -5
![]() ![]() | |