And Logical And Operator - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Operands
expression1 : Number
expression2 : Number
Returns
- A Boolean result of the logical operation.
Boolean
Example
The following example uses the logical AND (
player has won the game. The
player takes a turn or scores points during the game. The script shows "You Win the Game!"
in the Output panel when the player's score reaches 75 or higher in 3 turns or less.
var turns:Number = 2;
var score:Number = 77;
if ((turns <= 3) && (score >= 75)) {
trace("You Win the Game!");
} else {
trace("Try Again!");
}
// output: You Win the Game!
See also
! logical NOT operator
,
operator
|| logical OR operator
operator

and logical AND operator

condition1 and condition2
Deprecated since Flash Player 5. Macromedia recommends that you use the logical AND
(
operator.
&&)
Performs a logical AND (
, the entire expression is
true
Availability: ActionScript 1.0; Flash Player 4
Operands
condition1 : Boolean
condition2 : Boolean
- A Boolean value or an expression that converts to a Boolean value.
- A Boolean value or an expression that converts to a Boolean value.
&&
variable and the
turns
,
!= inequality operator
,
== equality operator
operation in Flash Player 4. If both expressions evaluate to
&&)
.
true
- Conditions or expressions that evaluate to
- Conditions or expressions that evaluate to
) operator to perform a test to determine if a
variable are updated when a
score
,
!== strict inequality
,
=== strict equality
or
.
true
false
or
.
true
false
Operators
173

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF