Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Operators > and | |||
Flash Lite 1.0.
condition1andcondition2
condition1, condition2 Conditions or expressions that evaluate to true or false.
Operator; performs a logical AND operation.
The following example uses the and operator to test whether a player has won the game. The turns variable and the score variable are updated when a player takes a turn or scores points during the game. The following script shows "You Win the Game!" in the Output panel when the player's score reaches 75 or higher in three turns or less.
turns = 2;
score = 77;
winner = (turns <= 3) and (score >= 75);
if (winner) {
trace("You Win the Game!");
} else {
trace("Try Again!");
}
// output: You Win the Game!
|
|
|
|