03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The message the logical OR test passed appears because one of the conditions in the if<br />

statement is true (y>200). Although the other two expressions evaluate to false, as long as<br />

one condition evaluates to true, the if block is executed.<br />

The following example demonstrates how using a function call as expression2 can lead to<br />

unexpected results. If the expression on the left of the operator evaluates to true, that result is<br />

returned without evaluating the expression on the right (the function fx2() is not called).<br />

function fx1():Boolean {<br />

trace("fx1 called");<br />

return true;<br />

}<br />

function fx2():Boolean {<br />

trace("fx2 called");<br />

return true;<br />

}<br />

if (fx1() || fx2()) {<br />

trace("IF statement entered");<br />

}<br />

/* The following is sent to the Output panel: /* The following is sent to<br />

the log file: fx1 called IF statement entered */<br />

See also<br />

! logical NOT operator, != inequality operator, !== strict inequality<br />

operator, && logical AND operator, == equality operator, === strict equality<br />

operator<br />

or logical OR operator<br />

condition1 or condition2<br />

Deprecated since Flash Player 5. This operator was deprecated in favor of the || (logical<br />

OR) operator.<br />

Evaluates condition1 <strong>and</strong> condition2, <strong>and</strong> if either expression is true, the whole expression<br />

is true.<br />

Oper<strong>and</strong>s<br />

condition1 : Boolean - An expression that evaluates to true or false.<br />

condition2 : Boolean - An expression that evaluates to true or false.<br />

Returns<br />

Boolean - The result of the logical operation.<br />

Operators 151

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!