03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - 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.

Example<br />

See also<br />

>>> bitwise unsigned right shift operator, >>= bitwise right shift <strong>and</strong><br />

assignment operator<br />

^ bitwise XOR operator<br />

expression1 ^ expression2<br />

Converts expression1 <strong>and</strong> expression2 to 32-bit unsigned integers, <strong>and</strong> returns a 1 in each<br />

bit position where the corresponding bits in expression1 or expression2, but not both, are<br />

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

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

Positive integers are converted to an unsigned hexadecimal 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 hexadecimal value via the two's complement notation, with the<br />

minimum being -2147483648 or 0x800000000; numbers less than the minimum are<br />

converted to two's complement with greater precision <strong>and</strong> also have the most significant digits<br />

discarded.<br />

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

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

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

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

expression1 : Number - A number.<br />

expression2 : Number - A number.<br />

Returns<br />

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

Example<br />

The following example uses the bitwise XOR operator on the decimals 15 <strong>and</strong> 9, <strong>and</strong> assigns<br />

the result to the variable x:<br />

// 15 decimal = 1111 binary<br />

// 9 decimal = 1001 binary<br />

var x:Number = 15 ^ 9;<br />

trace(x);<br />

154 <strong>ActionScript</strong> language elements

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

Saved successfully!

Ooh no, something went wrong!