Flash
  Home arrow Flash arrow Page 5 - What is ActionScript?
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

What is ActionScript?
By: Adi Reddy Mora
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 41
    2005-03-01

    Table of Contents:
  • What is ActionScript?
  • Curly Braces
  • Data Types
  • Variables
  • Debugging changes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    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.

       · I am Adi Reddy Mora, the author of this article from India. This is my 2nd article...
       · HiVery nice & brief information about action script for a beginner. Thanks for...
       · are you saying that with action script code i can make flash objects?
       · Hi, Adireddy, This is with reference to your profile, we are looking for the...
     

    FLASH ARTICLES

    - 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
    - Organizing Frames and Layers for Flash Anima...
    - Organizing Frames and Layers
    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT