Operators
163
The following example demonstrates how using a function call as
expression2
can lead to
unexpected results. If the expression on the left of the operator evaluates to
true
, that result is
returned without evaluating the expression on the right (the function
fx2()
is not called).
function fx1():Boolean {
trace("fx1 called");
return true;
}
function fx2():Boolean {
trace("fx2 called");
return true;
}
if (fx1() || fx2()) {
trace("IF statement entered");
}
/* The following is sent to the Output panel: /* The following is sent to
the log file: fx1 called IF statement entered */
See also
! logical NOT operator
,
!= inequality operator
,
!== strict inequality
operator
,
&& logical AND operator
,
== equality operator
,
=== strict equality
operator
or logical OR operator
condition1
or
condition2
Deprecated
since Flash Player 5. This operator was deprecated in favor of the
|| (logical
OR)
operator.
Evaluates
condition1
and
condition2
, and if either expression is
true
, the whole expression
is
true
.
Availability:
ActionScript 1.0; Flash Lite 1.0
Operands
condition1 :
Boolean
- An expression that evaluates to
true
or
false
.
condition2 :
Boolean
- An expression that evaluates to
true
or
false
.
Returns
Boolean
- The result of the logical operation.
See also
|| logical OR operator
,
| bitwise OR operator
Summary of Contents for FLASHLITE2 ACTIONSCRIPT-LANGUAGE
Page 1: ...Flash Lite 2 x ActionScript Language Reference...
Page 22: ...22 Contents...
Page 244: ...244 ActionScript language elements...
Page 760: ...760 ActionScript classes...