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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Parameters<br />

init - An expression to evaluate before beginning the looping sequence; usually an<br />

assignment expression. A var statement is also permitted for this parameter.<br />

Example<br />

The following example uses for to add the elements in an array:<br />

var my_array:Array = new Array();<br />

for (var i:Number = 0; i < 10; i++) {<br />

my_array[i] = (i + 5) * 10;<br />

}<br />

trace(my_array); // output: 50,60,70,80,90,100,110,120,130,140<br />

The following example uses for to perform the same action repeatedly. In the code, the for<br />

loop adds the numbers from 1 to 100.<br />

var sum:Number = 0;<br />

for (var i:Number = 1; i

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

Saved successfully!

Ooh no, something went wrong!