Flash Lite 1.x ActionScript 语言参考 |
|
|
|
| Flash Lite 语句 > else | |||
Flash Lite 1.0。
if (condition){t-statement(s);} else {f-statement(s);}
condition 计算结果为 true 或 false 的表达式。
t-statement 当条件的计算结果为 true 时要执行的指令。
f-statement 当条件的计算结果为 false 时要执行的替代指令系列。
语句;指定当 if 语句中的条件计算结果为 false 时要运行的语句。
以下示例说明如何将 else 语句与某一条件一起使用。实际的示例将包括根据该条件采取某一操作的代码。
currentHighestDepth = 1;
if (currentHighestDepth == 2) {
//trace ("currentHighestDepth is 2");
} else {
//trace ("currentHightestDepth is not 2");
}
|
|
|
|