Operators > ! (logical NOT)
! (logical NOT)Syntax
!
expression
Arguments
expression
A variable or evaluated expression.
Description
Operator (logical); inverts the Boolean value of a variable or expression. If expression
is a variable with an absolute or converted value true
, !
variable
the value of !
expression
is false
. If the expression x && y
evaluates to false
, the expression !(x && y)
evaluates to true
. This operator is identical to the not
operator that was used in Flash 4.
Player
Flash 4 or later.
Example
In the following example the variable happy
is set to false
, the if
condition evaluates the condition !happy,
and if the condition is true,
trace
sends a string to the Output window.
happy = false;
if (!happy){
trace("don't worry be happy");
}
The following illustrates the results of the!
operator:
!
true
returns false
!
false
returns true