EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Bitwise or Assignment Operator

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Operators 145
|= bitwise OR assignment operator
expression1 |= expression2
Assigns expression1 the value of expression1 | expression2. For example, the following
two statements are equivalent:
x |= y;
x = x | y;
Availability: ActionScript 1.0; Flash Player 5
Operands
expression1 : Number - A number or variable.
expression2 : Number - A number or variable.
Returns
Number - The result of the bitwise operation.
Example
The following example uses the bitwise OR assignment (
|=) operator:
// 15 decimal = 1111 binary
var x:Number = 15;
// 9 decimal = 1001 binary
var y:Number = 9;
// 1111 |= 1001 = 1111
trace(x |= y); // returns 15 decimal (1111 binary)
See also
& bitwise AND operator, &= bitwise AND assignment operator, ^ bitwise XOR
operator
, ^= bitwise XOR assignment operator, | bitwise OR operator, |=
bitwise OR assignment operator
, ~ bitwise NOT operator

Table of Contents

Related product manuals