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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

The following commented code uses the bitwise right shift <strong>and</strong> assignment (>>=) operator.<br />

function convertToBinary(numberToConvert:Number):String {<br />

var result:String = "";<br />

for (var i = 0; i>= 1;<br />

}<br />

return result;<br />

}<br />

trace(convertToBinary(479));<br />

// Returns the string 00000000000000000000000111011111<br />

// This string is the binary representation of the decimal<br />

// number 479<br />

See also<br />

>> bitwise right shift operator<br />

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

expression1 >>> expression2<br />

The same as the bitwise right shift (>>) operator except that it does not preserve the sign of the<br />

original expression because the bits on the left are always filled with 0.<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 />

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

expression1 : Number - A number or expression to be shifted right.<br />

expression2 : Number - A number or expression that converts to an integer between 0 <strong>and</strong><br />

31.<br />

Operators 125

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

Saved successfully!

Ooh no, something went wrong!