Learning ActionScript 2.0 in Adobe Flash |
|
|
|
| Syntax and Language Fundamentals > About statements > About compound statements | |||
A compound statement contains numerous statements that you enclose within curly brace ({}) punctuators. The statements inside a compound statement can be any kind of ActionScript statement. A typical compound statement is shown below.
The statements within the curly brace punctuators are indented from the compound statement, as the following ActionScript shows:
var a:Number = 10;
var b:Number = 10;
if (a == b) {
// This code is indented.
trace("a == b");
trace(a);
trace(b);
}
This compound statement contains several statements, but acts like a single statement in your ActionScript code. The opening brace is placed at the end of the compound statement. The closing brace begins a line, and aligns with the beginning of the compound statement.
For more information on using braces, see Curly braces.
|
|
|
|