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.

! logical NOT operator<br />

! expression<br />

Inverts the Boolean value of a variable or expression. If expression is a variable with the<br />

absolute or converted value true, the value of !expression is false. If the expression x &&<br />

y evaluates to false, the expression !(x && y) evaluates to true.<br />

The following expressions illustrate the result of using the logical NOT (!) operator:<br />

! true returns false! false returns true<br />

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

expression : Boolean - An expression or a variable that evaluates to a Boolean value.<br />

Returns<br />

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

Example<br />

In the following example, the variable happy is set to false. The if condition evaluates the<br />

condition !happy, <strong>and</strong> if the condition is true, the trace() statement sends a string to the<br />

Output panel.<br />

var happy:Boolean = false;<br />

if (!happy) {<br />

trace("don't worry, be happy"); //traces don't worry, be happy<br />

}<br />

The statement traces because !false equals true.<br />

See also<br />

!= inequality operator, !== strict inequality operator, && logical AND<br />

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

operator<br />

not logical NOT operator<br />

not expression<br />

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

NOT) operator.<br />

Performs a logical NOT (!) operation in Flash Player 4.<br />

Operators 149

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

Saved successfully!

Ooh no, something went wrong!