! (logical NOT) 229
Example
The following example uses ++ as a post-increment operator to make a while loop run five times.
i = 0;
while(i++ < 5){
trace("this is execution " + i);
}
This example uses ++ as a pre-increment operator.
var a = [];
var i = 0;
while (i < 10) {
a.push(++i);
}
trace(a.join());
This script displays the following result in the Output panel:
1,2,3,4,5,6,7,8,9,10
The following example uses ++ as a post-increment operator.
var a = [];
var i = 0;
while (i < 10) {
a.push(i++);
}
trace(a.join());
This script displays the following result in the Output panel:
0,1,2,3,4,5,6,7,8,9
! (logical NOT)
Availability
Flash Player 4.
Usage
!expression
Parameters
None.
Returns
A Boolean value.
Description
Operator (logical); inverts the Boolean value of a variable or expression. If expression is a
variable with the absolute or converted value
true, the value of !expression is false. If the
expression
x && y evaluates to false, the expression !(x && y) evaluates to true.
The following expressions illustrate the result of using the ! operator:
!true returns false
!false
returns true