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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Example<br />

The following example uses the logical AND (&&) operator to perform a test to determine if a<br />

player has won the game. The turns variable <strong>and</strong> the score variable are updated when a<br />

player takes a turn or scores points during the game. The script shows "You Win the Game!"<br />

in the Output panel when the player's score reaches 75 or higher in 3 turns or less.<br />

var turns:Number = 2;<br />

var score:Number = 77;<br />

if ((turns = 75)) {<br />

trace("You Win the Game!");<br />

} else {<br />

trace("Try Again!");<br />

}<br />

// output: You Win the Game!<br />

See also<br />

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

operator, || logical OR operator, == equality operator, === strict equality<br />

operator<br />

<strong>and</strong> logical AND operator<br />

condition1 <strong>and</strong> condition2<br />

Deprecated since Flash Player 5. <strong>Adobe</strong> recommends that you use the logical AND (&&)<br />

operator.<br />

Performs a logical AND (&&) operation in Flash Player 4. If both expressions evaluate to<br />

true, the entire expression is true.<br />

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

condition1 : Boolean - condition1,condition2 Conditions or expressions that evaluate<br />

to true or false.<br />

condition2 : Boolean - condition1,condition2 Conditions or expressions that evaluate<br />

to true or false.<br />

Returns<br />

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

See also<br />

&& logical AND operator<br />

148 ActionScript language elements

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

Saved successfully!

Ooh no, something went wrong!