03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4 decimal = 0100 binary<br />

// 8 decimal = 1000 binary<br />

See also<br />

>= bitwise right shift <strong>and</strong> assignment<br />

operator, >> bitwise right shift operator<br />

~ bitwise NOT operator<br />

~expression<br />

Also known as the one's complement operator or the bitwise complement operator. Converts<br />

the expressionto a 32-bit signed integer, <strong>and</strong> then applies a bitwise one's complement. That<br />

is, every bit that is a 0 is set to 1 in the result, <strong>and</strong> every bit that is a 1 is set to 0 in the result.<br />

The result is a signed 32-bit integer.<br />

For example, the hex value 0x7777 is represented as this binary number: 0111011101110111<br />

The bitwise negation of that hex value, ~0x7777, is this binary number: 1000100010001000<br />

In hexadecimal, this is 0x8888. Therefore, ~0x7777 is 0x8888.<br />

The most common use of bitwise operators is for representing flag bits (Boolean values packed<br />

into 1 bit each).<br />

Floating-point numbers are converted to integers by discarding any digits after the decimal<br />

point. Positive integers are converted to an unsigned hex value with a maximum value of<br />

4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant<br />

digits discarded when they are converted so the value is still 32-bit. Negative numbers are<br />

converted to an unsigned hex value via the two's complement notation, with the minimum<br />

being -2147483648 or 0x800000000; numbers less than the minimum are converted to two's<br />

complement with greater precision <strong>and</strong> also have the most significant digits discarded.<br />

The return value is interpreted as a two's complement number with sign, so the return value is<br />

an integer in the range -2147483648 to 2147483647.<br />

Oper<strong>and</strong>s<br />

expression : Number - A number.<br />

Returns<br />

Number - The result of the bitwise operation.<br />

Example<br />

The following example demonstrates a use of the bitwise NOT (-) operator with flag bits:<br />

120 ActionScript language elements

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!