break
Availability
Flash Player 4.
Usage
break
Parameters
None.
Returns
Nothing.
Description
Statement; appears within a loop (
statements associated with a particular case within a
statement instructs Flash to skip the rest of the loop body, stop the looping action, and
break
execute the statement following the loop statement. When used in a
instructs Flash to skip the rest of the statements in that
statement following the enclosing
In nested loops, the
out of the entire series of nested loops. For breaking out of an entire series of nested loops, see
try..catch..finally
Example
The following example uses the
var i:Number = 0;
while (true) {
trace(i);
if (i>=10) {
break;
// this will terminate/exit the loop
}
i++;
}
which writes the following output:
0
1
2
3
4
5
6
7
8
9
10
132
Chapter 5: ActionScript Core Language Elements
ActionScript Core Language Elements
,
for
for..in
switch
statement only skips the rest of the immediate loop and does not break
break
.
statement to exit an otherwise infinite loop:
break
,
or
do while
while
statement. When used in a loop, the
switch
block and jump to the first
case
statement.
CHAPTER 5
) or within a block of
, the
statement
switch
break
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?