03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The following example loops from 10 to 1, <strong>and</strong> each iteration of the loop decreases the<br />

counter variable i by 1.<br />

for (var i = 10; i>0; i--) {<br />

trace(i);<br />

}<br />

/ division operator<br />

expression1 / expression2<br />

Divides expression1 by expression2. The result of the division operation is a doubleprecision<br />

floating-point number.<br />

Oper<strong>and</strong>s<br />

expression : Number - A number or a variable that evaluates to a number.<br />

Returns<br />

Number - The floating-point result of the operation.<br />

Example<br />

The following statement divides the current width <strong>and</strong> height of the Stage, <strong>and</strong> then displays<br />

the result in the Output panel.<br />

trace(Stage.width/2);<br />

trace(Stage.height/2);<br />

For a default Stage width <strong>and</strong> height of 550 x 400, the output is 275 <strong>and</strong> 150.<br />

See also<br />

% modulo operator<br />

/= division assignment operator<br />

expression1 /= expression2<br />

Assigns expression1 the value of expression1 / expression2. For example, the<br />

following two statements are equivalent:<br />

x /= y; <strong>and</strong> x = x / y;<br />

Oper<strong>and</strong>s<br />

expression1 : Number - A number or a variable that evaluates to a number.<br />

expression2 : Number - A number or a variable that evaluates to a number.<br />

Operators 133

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!