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.

Jumps past all remaining statements in the innermost loop <strong>and</strong> starts the next iteration of the<br />

loop as if control had passed through to the end of the loop normally. It has no effect outside<br />

a loop.<br />

Example<br />

In the following while loop, continue causes the Flash interpreter to skip the rest of the loop<br />

body <strong>and</strong> jump to the top of the loop, where the condition is tested:<br />

trace("example 1");<br />

var i:Number = 0;<br />

while (i < 10) {<br />

if (i % 3 == 0) {<br />

i++;<br />

continue;<br />

}<br />

trace(i);<br />

i++;<br />

}<br />

In the following do..while loop, continue causes the Flash interpreter to skip the rest of the<br />

loop body <strong>and</strong> jump to the bottom of the loop, where the condition is tested:<br />

trace("example 2");<br />

var i:Number = 0;<br />

do {<br />

if (i % 3 == 0) {<br />

i++;<br />

continue;<br />

}<br />

trace(i);<br />

i++;<br />

}<br />

while (i < 10);<br />

In a for loop, continue causes the Flash interpreter to skip the rest of the loop body. In the<br />

following example, if the i modulo 3 equals 0, then the trace(i) statement is skipped:<br />

trace("example 3");<br />

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

if (i % 3 == 0) {<br />

continue;<br />

}<br />

trace(i);<br />

}<br />

In the following for..in loop, continue causes the Flash interpreter to skip the rest of the<br />

loop body <strong>and</strong> jump back to the top of the loop, where the next value in the enumeration is<br />

processed:<br />

for (i in _root) {<br />

if (i == "$version") {<br />

172 ActionScript language elements

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

Saved successfully!

Ooh no, something went wrong!