Bitwise Operators in ActionScript Part1 - ActionScript Tutorial 24

preview_player
Показать описание
Notes for You:: Bitwise Operators in ActionScript Part1 - ActionScript Tutorial 24

Bitwise Operators: are used to perform operations on bits.
Bitwise operators convert the given decimal number(s) to their binary equivalent number,
and then they perform the operations on bits of those binary equivalent number(s).

&: Bitwise And operator:
If both LHS and RHS are 1 then the result will be 1, in all other cases result will be 0

|: Bitwise Or operator:
If both LHS and RHS are 0 then the result will be 0, in all other cases result will be 1

^: Bitwise Exclusive Or operator:
If both LHS and RHS are same then the result will be 0, otherwise the result will be 1

~: Bitwise complement operator:
It is the unary operator, used to switch bits of the given operand.
It adds 1 to the given operand and changes the sign.

<<: Bitwise Left Shift operator:
Shifts the bits of LHS number to the left by number of positions indicated by RHS number
LHSNumber * pow(2,RHSNumber)

>>: Bitwise Right Shift operator:
Shifts the bits of LHS number to the right by number of positions indicates by RHS number
LHSNumber / pow(2,RHSNumber)

Example code:
trace("Bitwise operators");
trace(1 & 1); // 1
trace(1 & 0); // 0
trace(0 & 1); // 0
trace(0 & 0); // 0

trace(1 | 1); // 1
trace(1 | 0); // 1
trace(0 | 1); // 1
trace(0 | 0); // 0

trace(1 ^ 1); // 0
trace(1 ^ 0); // 1
trace(0 ^ 1); // 1
trace(0 ^ 0); // 0

trace(2 & 2); //2
trace(2 & 5); //0
trace(2 | 5); //7
trace(5 ^ 5); // 0
trace(2 ^ 5); // 7

trace(~2); //-3
trace(~5); //-6
trace(~-3); //2
trace(~-9); //8

trace(1<<4); //16
trace(5<<1); //10

trace(16>>4); //1
trace(20>>1); //10

Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.

=========================================

Follow the link for next video:

Follow the link for previous video:

=========================================

ActionScript Tutorials Playlist:-

=========================================
Watch My Other Useful Tutorials:-

How to Make Save Boundary Game in Flash with ActionScript:-

Adobe Flash Tutorials Playlist:-

Adobe Animate Tutorials Playlist:-

=========================================

► Subscribe to our YouTube channel:

► Visit our Website:

=========================================
Hash Tags:-
#ChidresTechTutorials #ActionScript #ActionScriptTutorial
Рекомендации по теме
Комментарии
Автор

SUBSCRIBE, SHARE & SUPPORT:
VISIT & LEARN AT FREE OF COST:

ChidresTechTutorials
Автор

Can you show how to control the character using action script?

boyapatiramakrishna
Автор

Brother, This is good tutorial. but I was looking for the tutorial to control the character through action script. that is like create walk cycle completely with action script.

boyapatiramakrishna