
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
The ActionScript Statements
|
147
Note that the opening curly brace appears at the end of the first line after parent_syntax.
The substatements of the statement block appear indented two spaces, each on its own
line. The closing curly brace, also on its own line, is flush with the main statement. Sub-
statements within statement blocks should end with a semicolon, but there are no semi-
colons on the lines with curly braces.
The indenting format is simply a convention, not a requirement of legal syntax. This
book adheres to the style used by the Flash ActionScript editor (the Actions panel).
The following format is also valid and common:
parent_syntax
{
substatement1;
substatement2;
substatement3;
}
The ActionScript Statements
Now that you know how a typical statement is formed, skim Table 6-1 to acquaint
yourself with some of the things that ActionScript statements do.
Table 6-1. The ActionScript statements
Statement Syntax Use
break
break;
Aborts a loop or switch statement
case
case expression:
statements
Identifies a statementto beexecuted conditionally ina
switch statement
continue
continue;
Skips the remaining statements in the current loop
and begins the next iteration at the top of the loop
default
default:
statements
Identifies the statement(s) to execute in a switch
statement when the test expression ...