Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Statements > else | |||
Flash Lite 1.0.
if (condition){t-statement(s);} else {f-statement(s);}
condition An expression that evaluates to true or false.
t-statement(s) The instructions to execute if the condition evaluates to true.
f-statement(s) An alternative series of instructions to execute if the condition evaluates to false.
Statement; specifies the statements to run if the condition in the if statement evaluates to false.
The following example shows the use of the else statement with a condition. An actual example would include code to take some action based on the condition.
currentHighestDepth = 1;
if (currentHighestDepth == 2) {
//trace ("currentHighestDepth is 2");
} else {
//trace ("currentHightestDepth is not 2");
}
|
|
|
|