User Guide
Operators 143
Operands
expression : Number - A number or a variable that evaluates to a number.
Returns
Number - The floating-point result of the operation.
Example
The following statement divides the current width and height of the Stage, and then displays
the result in the Output panel.
trace(Stage.width/2);
trace(Stage.height/2);
For a default Stage width and height of 550 x 400, the output is 275 and 150.
See also
% modulo operator
/= division assignment operator
expression1 /= expression2
Assigns expression1 the value of expression1 / expression2. For example, the
following two statements are equivalent:
x /= y; and x = x / y;
Availability: ActionScript 1.0; Flash Lite 1.0
Operands
expression1 : Number - A number or a variable that evaluates to a number.
expression2 : Number - A number or a variable that evaluates to a number.
Returns
Number - A number.
Example
The following code illustrates using the division assignment (
/=) operator with variables and
numbers:
var x:Number = 10;
var y:Number = 2;
x /= y; trace(x); // output: 5