ActionScript 2.0 Versus ActionScript 1.0

 <  Day Day Up  >  

Chapter 1 introduces ActionScript 2.0 in more detail, but this discussion provides a brief orientation for ActionScript 1.0 developers.

ActionScript 1.0 and ActionScript 2.0 have the same core syntax. Basics like conditionals, loops , operators, and other non-object-oriented aspects of ActionScript 1.0 can be used verbatim in ActionScript 2.0 and are still an official part of the language. In addition, object creation, property access, and method invocation have the same syntax in ActionScript 1.0 and ActionScript 2.0. So, generally speaking, ActionScript 2.0 is familiar to ActionScript 1.0 developers. The main difference between the two versions of the language is object-oriented syntax and authoring tool support for object-oriented development.

In ActionScript 1.0, object-oriented programming had an unintuitive syntax and nearly no authoring tool support (e.g., no compiler messages, no class file structure, no type checking, poor connections between code and movie assets, etc.). With ActionScript 1.0, object-oriented programming was an awkward , esoteric undertaking. With ActionScript 2.0, it is a natural endeavor. ActionScript 2.0's more traditional OOP implementation makes ActionScript 2.0 skills more transferable to and from other languages.

If you're an ActionScript 1.0 programmer and have already been applying OOP techniques, ActionScript 2.0 will be a delight (and a relief) to work with. If you're an ActionScript 1.0 programmer who doesn't use OOP, you don't need to learn OOP in ActionScript 1.0 before you learn it in ActionScript 2.0. Now is the perfect time to explore and adopt this important methodology. OOP offers to increase your productivity, make your projects easier to manage, and improve your code's quality and reusability.

Although this book doesn't spend a lot of time focusing on how to upgrade your code from ActionScript 1.0 to ActionScript 2.0, after reading it, you should have no trouble doing so. The book focuses on giving you a strong fundamental understanding of ActionScript 2.0 and I didn't want to unnecessarily distract from that focus by talking too much about obsolete ActionScript 1.0 code. That said, keep an eye out for the numerous ActionScript 1.0 notes that look like this:

figs/as1note.gif Such notes directly compare an ActionScript 1.0 technique with the analogous ActionScript 2.0 technique, so you can see the difference between the old way of doing things and the new, improved way.

Finally let's be clear about what I mean by "programming in ActionScript 2.0 versus ActionScript 1.0." If you are just creating timeline code and not using ActionScript 2.0 classes, static datatypes, or other OOP features, then it is really moot whether you refer to your code as "ActionScript 1.0" or "ActionScript 2.0." Without using OOP features, ActionScript 2.0 code looks indistinguishable from ActionScript 1.0 code. So when I say, "we're going to learn to program in ActionScript 2.0," of necessity, I'm assuming you're creating a meaningful OOP application in which you're developing one or more classes. For an example, consider an online form that merely sends an email. You might implement that form entirely on the Flash timeline using only variables and functions. If that's generally all you want to do with your applications, then frankly, this book might be overkill for your current needs. However, given the chance, this book will expand your horizons and teach you how to be a skilled object-oriented programmer and to tackle larger projects. So when I say "programming in ActionScript 2.0," I mean "developing object-oriented applications in ActionScript 2.0." The emphasis is on "object-oriented development" rather than ActionScript 2.0, per se, as ActionScript 2.0 is just a means to that end. You may ask, "Is this book about ActionScript 2.0 syntax, object-oriented design, or object-oriented programming?" The answer is, "All of the above."

For more information about ActionScript 2.0 and ActionScript 1.0 in relation to Flash Player 6 and Flash Player 7, see Chapter 1.

 <  Day Day Up  >  


Essential ActionScript 2.0
Essential ActionScript 2.0
ISBN: 0596006527
EAN: 2147483647
Year: 2004
Pages: 177
Authors: Colin Moock

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net