%= modulo assignment operator

expression1 %= expression2

Assigns expression1 the value of expression1 % expression2. The following two statements are equivalent:

x %= y; 
x = x % y;

Availability: ActionScript 1.0; Flash Player 4 - In Flash 4 files, the % operator is expanded in the SWF file as x - int(x/y) * y and may not be as fast or as accurate in later versions of Flash Player.

Operands

expression1 : Number - A number or expression that evaluates to a number.

expression2 : Number - A number or expression that evaluates to a number.

Returns

Number - The result of the arithmetic operation.

Example

The following example assigns the value 4 to the variable x:

var x:Number = 14; 
var y:Number = 5; 
trace(x = y); // output: 4 

See also

% modulo operator


Flash CS3


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00001295.html