(Logical Not) - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

! (logical NOT)

Availability
Flash Player 4.
Usage
!expression
Parameters
An expression or a variable that evaluates to a Boolean value.
expression
Returns
A Boolean value.
Description
Operator (logical); inverts the Boolean value of a variable or expression. If
variable with the absolute or converted value
expression
x && y
The following expressions illustrate the result of using the logical NOT (!) operator:
returns
!true
false
returns
!false
true
For more information, see "Operator precedence and associativity" in Using ActionScript in Flash.
Example
In the following example, the variable
condition
!happy
Output panel.
var happy:Boolean = false;
if (!happy) {
trace("don't worry, be happy");//traces don't worry, be happy
}
The statement traces because
See also
!=
(inequality),
!== (strict
(strict equality)
evaluates to
, the expression
false
happy
, and if the condition is
equals
!false
inequality),
&& (logical
, the value of
true
!(x && y)
is set to
. The
false
, the
statement sends a string to the
true
trace()
.
true
AND),
|| (logical
expression
is
!expression
false
evaluates to
.
true
condition evaluates the
if
OR),
==
(equality),
! (logical NOT)
is a
. If the
===
29

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash mx

Table of Contents