MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 159

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Performs a Boolean operation on the values of one or both of the expressions. Evaluates
(the expression on the left side of the operator) and returns
expression1
expression evaluates to
expression on the right side of the operator) is evaluated. If
the final result is
true
false
true&&false
false&&false
Availability: ActionScript 1.0; Flash Lite 1.0
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
. If
false
expression1
; otherwise, it is
false
false
false&&true
- 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
evaluates to
,
true
expression2
expression2
. Expression Evaluates
false
) operator to perform a test to determine if a
&&
variable are updated when a
score
,
!== strict inequality
,
=== strict equality
if the
false
(the
evaluates to
true
true
true&&true
Operators
,
159

Advertisement

Table of Contents
loading

Table of Contents