Flash Lite 1.x ActionScript 语言参考 |
|
|
|
| Flash Lite 运算符 > and | |||
Flash Lite 1.0。
condition1andcondition2
condition1、condition2 计算结果为 true 或 false 的条件或表达式。
运算符;执行逻辑 AND 运算。
以下示例使用 and 运算符测试游戏者是否在游戏中获胜。在游戏过程中,当游戏者赢得一轮或者得到计分点时,就会对 turns 和 score 变量进行更新。在 3 轮之内游戏者的得分达到或超过 75 时,下面的脚本就会在"输出"面板中显示 "You Win the Game!"(您获得了游戏的胜利!)。
turns = 2;
score = 77;
winner = (turns <= 3) and (score >= 75);
if (winner) {
trace("You Win the Game!");
} else {
trace("Try Again!");
}
// 输出:You Win the Game!
|
|
|
|