! (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
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...