and

Availability

Flash Lite 1.0.

Usage

condition1 and condition2

Operands

condition1, condition2 Conditions or expressions that evaluate to true or false.

Description

Operator; performs a logical AND operation.

Example

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!

See also

&& (logical AND)