break

Availability

Flash Lite 1.0.

Usage

break 

Parameters

None.

Description

Statement; appears within a loop (for, do..while or while) or within a block of statements associated with a particular case within a switch statement. The break statement instructs Flash Lite to skip the rest of the loop body, stop the looping action, and execute the statement following the loop statement. When using the break statement, the ActionScript interpreter skips the rest of the statements in that case block and jumps to the first statement following the enclosing switch statement. Use this statement to break out of a series of nested loops.

Example

The following example uses the break statement to exit an otherwise infinite loop:

i = 0;
while (true) {
    if (i >= 100) {
        break;
    }
    i++;
}

See also

case, do..while, for, switch, while