Operands
expression1 : Number
expression2 : Number
Returns
- The result of the arithmetic operation.
Number
Example
The following example uses the subtraction assignment (
and assign the result to the variable
var x:Number = 5;
var y:Number = 10;
x -= y; trace(x); // output: -5
The following example shows how strings are converted to numbers:
var x:String = "5";
var y:String = "10";
x -= y; trace(x); // output: -5
See also
- subtraction operator
: type operator
[ modifiers ] var variableName : type
function functionName () : type { ... }
function functionName ( parameter1:type , ... , parameterN:type ) [ :type ]{
... }
Used for strict data typing; this operator specifies the variable type, function return type, or
function parameter type. When used in a variable declaration or assignment, this operator
specifies the variable's type; when used in a function declaration or definition, this operator
specifies the function's return type; when used with a function parameter in a function
definition, this operator specifies the variable type expected for that parameter.
Types are a compile-time-only feature. All types are checked at compile time, and errors are
generated when there is a mismatch. Mismatches can occur during assignment operations,
function calls, and class member dereferencing using the dot (
mismatch errors, use strict data typing.
Types that you can use include all native object types, classes and interfaces that you define,
and Function and Void. The recognized native types are Boolean, Number, and String. All
built-in classes are also supported as native types.
- A number or expression that evaluates to a number.
- A number or expression that evaluates to a number.
:
x
operator to subtract 10 from 5
-=)
) operator. To avoid type
.
Operators
189
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?