EasyManua.ls Logo

MACROMEDIA FLASH 8-FLASH LITE 1.X ACTIONSCRIPT LANGUAGE - Page 109

MACROMEDIA FLASH 8-FLASH LITE 1.X ACTIONSCRIPT LANGUAGE
162 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
-= (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

Table of Contents

Related product manuals