Description
Operator (logical); evaluates
expressions evaluate to
can use the logical OR operator with any number of operands; if any operand evaluates to
the result is
true
With non-Boolean expressions, the logical OR operator causes Flash to evaluate the expression on
the left; if it can be converted to
the right and the result is the value of that expression.
Example
Usage 1: The following example uses the
evaluates to
true
x = 10
y = 250
start = false
if(x > 25 || y > 200 || start){
trace('the logical OR test passed');
}
Usage 2: This example demonstrates how a non-Boolean expression can produce an unexpected
result. If the expression on the left converts to
expression on the right.
function fx1(){
trace ("fx1 called");
returns true;
}
function fx2(){
trace ("fx2 called");
return true;
}
if (fx1() || fx2()){
trace ("IF statement entered");
}
// The following is sent to the Output panel:
// fx1 called
// IF statement entered
|= (bitwise OR assignment)
Availability
Flash Player 5.
Usage
expression1 |= expression2
Parameters
expression1,expression2
Returns
None.
250
Chapter 12: ActionScript Dictionary
expression1
; the result is
true
.
, the result is
true
so the final result is
true
A number or variable.
and
. The result is
expression2
only if both expressions evaluate to
false
. Otherwise, it evaluates the expression on
true
operator in an
statement. The second expression
||
if
:
, that result is returned without converting the
true
if either or both
true
. You
false
,
true
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?