.shivanshi.
. Home . Share . Share Success . Join Us! .

ActionScript - Code Samples

Continue Statement

The continue statement forces to jump to the beginning of the loop. It skips any code within the loop body after the statement.

Download continue.fla.

Let us see a for loop.
var num = 10;
for (var i = 1; i<=num; i++) {
	trace("-------------");
	trace("number: "+i);
	if (i == 5) {
		// when i is equal to five, 
		// continue statement forces to skip the code 
		// and start the next iteration.
		// So, we do not get the square of 5 in trace output.
		continue;
	}
	var square = i*i;
	trace("square: "+square);
}
trace("-------------");

Add Favorite
| About Us | Site Map | Privacy Policy | Contact Us |
.shivanshi.