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.

expression2 : Number - A number.<br />

Returns<br />

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

Example<br />

The following is an example of a bitwise OR (|) operation:<br />

// 15 decimal = 1111 binary<br />

var x:Number = 15;<br />

// 9 decimal = 1001 binary<br />

var y:Number = 9;<br />

// 1111 | 1001 = 1111<br />

trace(x | y); // returns 15 decimal (1111 binary)<br />

Don't confuse the single | (bitwise OR) with || (logical OR).<br />

See also<br />

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

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

operator, ~ bitwise NOT operator<br />

|= bitwise OR assignment operator<br />

expression1 |= expression2<br />

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

two statements are equivalent:<br />

x |= y; <strong>and</strong> x = x | y;<br />

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

expression1 : Number - A number or variable.<br />

expression2 : Number - A number or variable.<br />

Returns<br />

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

Example<br />

The following example uses the bitwise OR assignment (|=) operator:<br />

// 15 decimal = 1111 binary<br />

var x:Number = 15;<br />

// 9 decimal = 1001 binary<br />

122 ActionScript language elements

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

Saved successfully!

Ooh no, something went wrong!