SunQuest
 
       Flash
  Home arrow Flash arrow Page 7 - ActionScript 2.0 Overview
IBM developerWorks
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  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
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

ActionScript 2.0 Overview
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 20
    2004-08-03

    Table of Contents:
  • ActionScript 2.0 Overview
  • Features Introduced by Flash Player 7
  • Flash MX 2004 Version 2 Components
  • New Component Features in v2
  • ActionScript 1.0 and 2.0 in Flash Player 6 and 7
  • Setting a Movie’s ActionScript Version and Player Version
  • Changes to ActionScript 1.0 in Flash Player 7

  • 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    ActionScript 2.0 Overview - Changes to ActionScript 1.0 in Flash Player 7


    (Page 7 of 7 )

    In a Flash Player 7–format .swf file running in Flash Player 7, some ActionScript 1.0 code behaves differently than it does in Flash Player 6. These changes bring Flash Player 7 closer to full ECMAScript 3 compliance. Specifically:

    • The value undefined converts to the number NaN when used in a numeric context and to the string “undefined” when used in a string context (in Flash Player 6, undefined converts to the number 0 and to the empty string, “”).

    • Any nonempty string converts to the Boolean value true when used in a Boolean context (in Flash Player 6, a string converts to true only if it can be converted to a valid nonzero number; otherwise, it converts to false).

    • Identifiers (function names, variable names, property names, etc.) are case sensitive. For example, the identifiers firstName and firstname refer to two different variables in Flash Player 7. In Flash Player 6, the identifiers would refer to a single variable. (However, as usual, frame labels and symbol linkage IDs are not case sensitive.)

    The preceding changes affect you only when you are updating a Flash Player 6–format movie to a Flash Player 7–format movie in order to use a feature unique to Flash Player

    7. That is, if you upgrade your movie, you must test and possibly modify your code to make sure that it operates the same in Flash Player 7 format as it did in Flash Player 6 format. If you do not need Flash Player 7 features in your movie, you can continue to export it to Flash Player 6 format and it will usually run in Flash Player 7 exactly as it did in Flash Player 6. This last point cannot be emphasized enough.

    Macromedia goes to great lengths to ensure that movies exported in older versions of the .swf format, such as Flash Player 6 format, continue to operate unchanged even if played in a later Player, such as Flash Player 7. However, when you publish a movie in Flash Player 7 format, you must be mindful of the changes implemented since the previous version of the .swf format. That is, the changes needed in your ActionScript depend on the .swf file version, not the Flash Player version.

    Of course, any newly created .swf files exported in Flash Player 7 format (and not just those upgraded from Flash Player 6–format .swf files) must obey the new conventions, so keep them in mind moving forward. Remember that these new conventions bring ActionScript in line with other languages such as JavaScript and Java, making it easier to port code to or from other languages.

    Flash 4 Slash Syntax Is Not Supported in ActionScript 2.0

    In Flash 4 and subsequent versions, variables could be referenced with so-called “slash syntax.” For example, in Flash 4, the following code is a reference to the variable x on the movie clip ball:

    /ball:x

    That syntax generates the following error if you attempt to use it with the Action-Script 2.0 compiler, whether exporting in Flash Player 6 or Flash Player 7 format:

    Unexpected '/' encountered

    Let’s Go OOP

    Now that we’ve had a taste of what ActionScript 2.0 has to offer, we can start our study of object-oriented programming with Flash in earnest. When you’re ready to get your hands dirty, move on to Chapter 2!

    Buy the book!If you've enjoyed what you've seen here, or to get more information, click on the "Buy the book!" graphic. Pick up a copy today!

    Visit the O'Reilly Network http://www.oreillynet.com for more online content.


    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.

     

    FLASH ARTICLES

    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications
    - ActionScript in Flex Applications
    - A Closer Look at Apollo`s File System API
    - Using the File System API
    - ActionScript 101
    - Flash Buttons
    - Advanced Flash Animation
    - Creating Your First Animated Movie with Flas...
    - Flash: Building Blocks
    - Building Preloaders
    - Fun Things to Do with Movie Clips in Flash MX
    - Referencing Movie Clips in Flash MX







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway