Home arrow Flash arrow Page 5 - What is ActionScript?
FLASH

What is ActionScript?


Have you never used ActionScript before, and want to learn? This article will help you get started. Have you used only ActionScript 1.0, and wonder what changed with version 2.0? Keep reading to find out.

Author Info:
By: Adi Reddy Mora
Rating: 4 stars4 stars4 stars4 stars4 stars / 54
March 01, 2005
TABLE OF CONTENTS:
  1. · What is ActionScript?
  2. · Curly Braces
  3. · Data Types
  4. · Variables
  5. · Debugging changes

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
What is ActionScript? - Debugging changes
(Page 5 of 5 )

This section describes changes that improve your ability to debug your ActionScript programs.

Output window changed to Output panel You can now move and dock the Output panel in the same way as any other panel in Flash. It shows error messages (including some runtime errors) and lists of variables and objects

Improved error reporting at compile time In addition to providing more robust exception handling, ActionScript 2.0 provides several new compile-time errors.

Improved exception handling The Error class and the throw and try..catch..finally statements let you test and respond to runtime errors from within your script so that you can implement more robust exception handling.

Changes compared to ActionScript 1.0

The following are the major changes that you will find in ActionScript 2.0 when compared with 1.0.

Case Sensitivity: Case sensitivity is the new feature introduced in ActionScript 2.0, and whenever you publish your movie in Flash Player 7 or later it will be applied to your code. That means variable names that differ only in case (depth and Depth) are considered different from each other. This applies to keywords, class names, variables, method names, and so on.

This change also affects external variables loaded with LoadVars.load() or loadvariables().

Case-sensitivity is implemented in external scripts such as class files, scripts that you import using the #include command, and scripts that you write in your flash movie.

Strict Data Typing: This is another useful feature that allows you to type cast your variables to their appropriate data types, so that you can restrict variables to accept only specified data type values.

When creating a variable with ActionScript 2.0, use the following syntax not only to create the variable, but also to assign its data type at the same time:

var a:String = "Hello World";

The above line says that "a" is a variable of string data type. If you assign any other data type value to "a" (Example: a = 20) it throws a "Type mismatch" error when compiled. Strict data typing also applies to classes, functions to type cast function parameters, return types, and so forth. Example:

var my_array:Array = new Array(); var my_lv:LoadVars = new LoadVars(); function myFunction(name:String, age:Number):Void { }

It is recommended to type cast all variables, classes, functions, and so forth that you use in your script; it proves to be a good programming practice.

Conclusion

This introduction just tells you the basics and core features and changes in ActionScript 2.0 compared to ActionScript 1.0. However there are a lot more useful features and concepts available in ActionScript 2.0, using which you can create some wonderful flash based applications.

Here are some useful ActionScript resources over the Web for you to get started using ActionScript:

http://www.macromedia.com/devnet/mx/flash/actionscript.html

http://www.actionscript.com/

http://www.actionscripts.org/


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
FLASH ARTICLES

- More Top Flash Game Tutorials
- Top Flash Game Tutorials
- Best Flash Photo Gallery Tutorials
- The Top Flash Tutorials for Menus
- 7 Great Flash Tutorials
- Adobe Creative Suite 5.5 Now Available
- Critical Flash Vulnerability Heats Up the Web
- More on Nonpersistent Client-Side Remote Sha...
- Nonpersistent Client-Side Remote Shared Obje...
- Using the Decorator Pattern for a Real Web S...
- Using Concrete Decorator Classes
- Delving More Deeply into the Decorator Patte...
- The Decorator Pattern in Action
- A Simple Decorator Pattern Example
- Decorator Pattern

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials