Flashadvisor logo
:: Desktop Shortcut
:: Flash Help
Advices from Experts

 Submit Here! · Link to Us · Newsletter · Tell a Friend ·

      Add Tutorial |

 

Advertise here










 

Google

Search WWW   
FlashAdvisor.com

 Home > Tutorials  > ActionScript

Flash Actionscript Programming Basics

Author: steve happ | Email
Website : www.video-animation.com


Advertisement


Bitwise Operators



Bitwise operators operate on the value to base 2 (binary). Operands must be integers.

Left Shift ("<<") - shifts the bits of the left operand some number of positions to the left.
e.g.


someNum = 1;
0 0 0 0 0 0 0 1

SomeNum = someNum<<1;
0 0 0 0 0 0 1 0

SomeNum = someNum<<2;
0 0 0 0 1 0 0 0

Right Shift (">>")
SomeNum = someNum >>3;
0 0 0 0 0 0 0 1

The leftShift operator inserts "0" from the right.
The Right Shift operator inserts "0" from the left.



Variables (AS 2.0)



A variable is identified by a user-supplied name. Each variable is of a particular data type. E.g.


Var num:Number;

"Number" is a type specifier. A declaration can follow the template:

var variableName:DataType;


  • The use of the ":Datatype" is not strictly enforced in AS2 but I strongly recommend it.

  • A variable can be composed of letters, numbers and underscore. Upper and lower case letters are different.

  • Variables need to be initialised. I.e. given an initial value.

    var myNum:Number; //Declaration
    myNum = 0; //Initialisation


  • In AS 1.0, variables are not strictly typed and can change types.




| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | 14 | 15 |

Rate This Tutorial :
We hope the information helped you. If you have any questions or comments, please don't hesitate to post them on the Forums section
Submit your Tutorial at Click Here
  

Home | About Us | Contact Us | Feedback | Advertise with us

Best viewed in 800x600 resolution with Internet Explorer.

Site Developed and Hosted by  ethicsolutions.com
All rights reserved with FlashAdvisor

Flash is a registered trademark of Adobe Systems, Inc.

27 users online