<< (bitwise left shift)
Availability
Flash Player 5.
Usage
expression1 << expression2
Parameters
expression1
expression2
Returns
Nothing.
Description
Operator (bitwise); converts
the bits in
expression1
the conversion of
filled in with 0. Shifting a value left by one position is the equivalent of multiplying it by 2.
Example
In the following example, the integer 1 is shifted 10 bits to the left.
x = 1 << 10
The result of this operation is
shifted left by 10 is 10000000000 binary, and 10000000000 binary is 1024 decimal.
In the following example, the integer 7 is shifted 8 bits to the left.
x = 7 << 8
The result of this operation is
shifted left by 8 bits is 11100000000 binary, and 11100000000 binary is 1792 decimal.
See also
>>= (bitwise right shift and assignment)
left shift and assignment)
<<= (bitwise left shift and assignment)
Availability
Flash Player 5.
Usage
expression1 <<= expression2
Parameters
expression1
expression2
A number or expression to be shifted left.
A number or expression that converts to an integer from 0 to 31.
expression1
to the left by the number of places specified by the integer resulting from
. The bit positions that are emptied as a result of this operation are
expression2
x = 1024
x = 1792
A number or expression to be shifted left.
A number or expression that converts to an integer from 0 to 31.
and
expression2
. This is because 1 decimal equals 1 binary, 1 binary
. This is because 7 decimal equals 111 binary, 111 binary
,
>> (bitwise right shift)
<<= (bitwise left shift and assignment)
to 32-bit integers, and shifts all of
,
<<= (bitwise
255
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?