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.

Returns<br />

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

Example<br />

The following example compares the bit representation of the numbers <strong>and</strong> returns 1 only if<br />

both bits at the same position are 1. In the following ActionScript code, you add 13 (binary<br />

1101) <strong>and</strong> 11 (binary 1011) <strong>and</strong> return 1 only in the position where both numbers have a 1.<br />

var insert:Number = 13;<br />

var update:Number = 11;<br />

trace(insert & update); // output : 9 (or 1001 binary)<br />

In the numbers 13 <strong>and</strong> 11 the result is 9 because only the first <strong>and</strong> last positions in both<br />

numbers have the number 1.<br />

The following example shows the behavior of the return value conversion:<br />

trace(0xFFFFFFFF); // 4294967295<br />

trace(0xFFFFFFFF & 0xFFFFFFFF); // -1<br />

trace(0xFFFFFFFF & -1); // -1<br />

trace(4294967295 & -1); // -1<br />

trace(4294967295 & 4294967295); // -1<br />

See also<br />

&= bitwise AND assignment operator, ^ bitwise XOR operator, ^= bitwise XOR<br />

assignment operator, | bitwise OR operator, |= bitwise OR assignment operator,<br />

~ bitwise NOT operator<br />

&= bitwise AND assignment operator<br />

expression1 &= expression2<br />

Assigns expression1 the value of expression1& expression2. For example, the following<br />

two expressions are equivalent:<br />

x &= y;<br />

x = x & y;<br />

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

expression1 : Number - A number.<br />

expression2 : Number - A number.<br />

Returns<br />

Number - The value of expression1 & expression2 .<br />

Operators 117

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

Saved successfully!

Ooh no, something went wrong!