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


DataTypes (AS 2.0 only)



Variables in AS 2.0 can be given strict datatypes such as a Number or a String or a Boolean.
e.g.


var myNum:Number;
var myString:String;
var isTested:Boolean;

In AS 1.0 there is no strict datatyping. A number can become a String and vice versa.
e.g.

num = 10;
num = "Test";

Strict datatyping can capture errors.



Compiler Errrors



  1. Syntax errors - e.g. var numberOne:
  2. Spelling Mistakes - var mc:MoveiClip;
  3. DataType Errors - (AS 2.0)



var num1:Number;
var str1:String;
num1 = "Steve";
str1 = 27;




Flow control



IF



An if statement tests a condition. If it is true, then a set of actions is executed.
Otherwise, the set is ignored or bypassed. Here is a template :


If(expression){
Statement1;
}

Here is an example :

var x = 23;
if(x>3){
trace("x is greater than 3");
}




| 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.

1 user online