MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 251

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

Description
Operator (bitwise compound assignment); assigns
. For example, the following two statements are the same:
expression2
x |= y;
x = x | y;
Example
The following example uses the
// 15 decimal = 1111 binary
x = 15;
// 9 decimal = 1001 binary
y = 9;
trace(x |= y);
// 1111 |= 1001
// returns 15 decimal (= 1111 binary)
See also
| (bitwise OR)
~ (bitwise NOT)
Availability
Flash Player 5.
Usage
~ expression
Parameters
A number.
expression
Returns
None.
Description
Operator (bitwise); converts the
bitwise NOT operation changes the sign of a number and subtracts 1.
Example
The following example shows a bitwise NOT operation performed on a variable.
a = 0;
trace ("when a = 0, ~a = "+~a);
// when a = 0, ~a = -1
a = 1;
trace ("when a = 1, ~a = "+~a);
// when a = 0, ~a = -2
// therefore, ~0=-1 and ~1=-2
expression1
operator:
|=
to a 32-bit unsigned integer, then inverts the bits. A
expression
the value of
expression1 |
~ (bitwise NOT)
251

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

Table of Contents