Home arrow Flash arrow Page 5 - ActionScript 2.0 Overview
FLASH

ActionScript 2.0 Overview


This chapter presents some basics of ActionScript 2.0. It offers a quick summary of ActionScript 2.0’s core features and Flash Player 7’s new capabilities such as syntactic support for traditional object-oriented features and CSS-based stylesheet support. (From the book Essential ActionScript 2.0, by Colin Moock, O'Reilly Media, ISBN:0596006527.)

Author Info:
By: O'Reilly Media
Rating: 4 stars4 stars4 stars4 stars4 stars / 34
August 03, 2004
TABLE OF CONTENTS:
  1. · ActionScript 2.0 Overview
  2. · Features Introduced by Flash Player 7
  3. · Flash MX 2004 Version 2 Components
  4. · New Component Features in v2
  5. · ActionScript 1.0 and 2.0 in Flash Player 6 and 7
  6. · Setting a Movie’s ActionScript Version and Player Version
  7. · Changes to ActionScript 1.0 in Flash Player 7

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
ActionScript 2.0 Overview - ActionScript 1.0 and 2.0 in Flash Player 6 and 7
(Page 5 of 7 )

ActionScript 1.0 is based on the ECMAScript 3 standard (as is JavaScript 1.5), whereas ActionScript 2.0 is based on the emerging ECMAScript 4 standard (as is the theoretical JavaScript 2.0). As we learned in the Preface, under “ActionScript 2.0 Versus ActionScript 1.0,” this common heritage gives the two versions a strong family resemblance; they share the same syntax for most non-OOP features, such as loops, conditionals, and operators.

Although ActionScript 2.0 is now the preferred version of ActionScript, ActionScript 1.0 syntax continues to be fully supported by Flash Player 7 and is not deprecated. As we’ll see shortly, you can author either ActionScript 1.0 or ActionScript 2.0 in Flash MX 2004 and Flash MX Professional 2004 (but you cannot author ActionScript 2.0 in Flash MX). With a few minor exceptions, noted throughout the text, ActionScript 2.0 code is also backward compatible with Flash Player 6. However, ActionScript 2.0 is not compatible with older versions such as Flash Player 5 or Flash Player 4.

If you’re an ActionScript 1.0 programmer, you can think of ActionScript 2.0 as a syntactic façade over ActionScript 1.0. That is, both ActionScript 2.0 and ActionScript 1.0

compile to the same .swf bytecode (with a few minor additions for ActionScript 2.0). To the Flash Player, at runtime, there’s effectively no difference between ActionScript 1.0 and ActionScript 2.0 (barring the aforementioned minor additions). For example, once an ActionScript 2.0 class, such as Rectangle, is compiled to a .swf file, it exists as a Function object at runtime, just as an older ActionScript 1.0 function declaration used as a class constructor would. Similarly, at runtime, an ActionScript 2.0 Rectangle instance (r) is given a __proto__ property that refers to Rectangle.prototype, again making it look to the Flash Player just like its ActionScript 1.0 counterpart.

But for the most part, you don’t need to worry about these behind-the-scenes compiler and runtime issues. If you’re moving to ActionScript 2.0 (and I think you should!), you can permanently forget ActionScript 1.0’s prototype-based programming. In fact, most ActionScript 1.0 techniques for dynamically manipulating objects and classes at runtime are considered bad practice in ActionScript 2.0, and will actually lead to compiler errors when mixed with ActionScript 2.0 code. But never fear, this book highlights problematic ActionScript 1.0 practices and show you how to replace them with their modern ActionScript 2.0 counterparts.

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.


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 7 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials