Foreword

 <  Day Day Up  >  

I came to Macromedia in the summer of 2000, shortly after graduating from college, to start working as a software engineer on the Flash team. In my first days at the company, the team was working tirelessly to ship Flash 5, and everyone was too busy to give me much work to do, let alone guide me in the ways of Macromedia corporate life. Little did I realize that as I was learning my way around the complex C++ architecture of the Flash authoring tool, ActionScript was also beginning its own career in the web development industry. Flash 5 was a landmark release for the Flash authoring tool: it brought ActionScript from an interface that required point-and-click interaction to a full-fledged scripting language based on the ECMAScript standard, with a real text editor. I arrived just as the Flash team was putting real scripting power in the hands of Flash developers. Over the next two releases of Flash, I participated in the continuation of that effort, first by producing the ActionScript debugger in Flash MX and, most recently, by developing the ActionScript 2.0 compiler. My past few years are inextricably linked to this language, and it has contributed to my growth, just as I have contributed to its growth.

In the beginning, my feelings about ActionScript were similar to the feelings a lot of traditional developers have when coming to the language. I found myself comfortable with its flexibility, yet frustrated with its limitations. I was happy to bring features such as the debugger to life, because it helped Flash meet my own expectations of a programming environment. I enjoyed working to close the gaps in Flash's capabilities, feature by feature. With Flash MX, we made strides by greatly improving the code editor and by enabling users to debug their ActionScript. However, ActionScript 1.0 still had one frustrating limitation that we did not address in Flash MX: it was possible to write code that employed object-oriented programming (OOP) techniques, but doing so was complex and unintuitive and not well integrated with Flash concepts like library symbols.

With Flash MX 2004 and ActionScript 2.0, we have arrived at yet another major landmark in ActionScript's evolution. ActionScript 2.0 offers a more sophisticated syntax for the OOP constructs that ActionScript has always supported. ActionScript 2.0 is easier to learn than its predecessor, and it is closer to other industry-standard programming languages, such as Java and C#. It gives developers the framework needed to build and maintain large, complex applications. In addition, our implementation required minimal changes to the Flash Player, meaning that ActionScript 2.0 can be exported to Flash Player 6, which was already nearly ubiquitous at the time of Flash MX 2004's release.

In the short time that ActionScript has been around, developers have found it to be extraordinarily powerful. Flash places few constraints on the developer's access to the MovieClip hierarchy and object model, permitting them to do anything, anywhere . This flexibility has stirred the creativity of our users, enabling them to grow into ActionScript and experiment with it. However, the lack of structure in ActionScript 1.0 made applications difficult to scale up, leading to unwieldy projects that teams found challenging to maintain and organize. It was too easy to write poor code, not to mention place code in locations almost impossible to find by others unfamiliar with the project. ActionScript 2.0 aspires to address these pitfalls by encouraging a structure that all developers can adhere to and understand. Moreover, the ActionScript 2.0 compiler provides developers with feedback on errors that otherwise wouldn't be found until they manifested as bugs at runtime. Still, ActionScript continues to provide extensive and unique control over graphical elements. We strove to ensure that ActionScript is a powerful language moving forward, without treading on the toes of already-seasoned scripters.

ActionScript 2.0 was also the basis for several other notable elements of Flash MX 2004.

The following are all written in ActionScript 2.0:

  • The second generation of components (i.e., the v2 components )

  • The new Screens metaphor, which includes Slides and Forms (available only in Flash MX Professional 2004)

  • The sophisticated data integration capabilities

  • The multilingual resource support offered by the Strings panel

Building significant, large-scale features using ActionScript 2.0 provided valuable testing and validation to those of us working on the compiler and informed many of our design decisions. More importantly, these features give Flash developers comprehensive, working examples of ActionScript 2.0 in action (see the Macromedia/Flash MX 2004/en/First Run/Classes folder under your application's installation folder). Likewise, the benefits of ActionScript 2.0 are readily apparent in these features, which all consist of classes that are well organized in the mx.* class hierarchy. In addition, it is easier than ever to determine which code corresponds to the different components, as ActionScript 2.0 has made it possible to eliminate troublesome relics of ActionScript's past, such as the #initclip pragma (compiler directive).

ActionScript started life as a few scripting commands inserted by mouse clicks. Five years later, it is a full-featured object-oriented language with which large, complex applications can be developed. Furthermore, it presents a clean, simple syntax that is easy to read and straightforward for a beginner to pick up. In my two releases of the Flash authoring tool, I have learned more and more about ActionScript each step of the way, and now I am proud to have helped redefine it. Colin Moock's previous book, ActionScript for Flash MX: The Definitive Guide , was indispensable to me, even as I've worked on the new face of ActionScript. It is the single book you'll find within easy reach at the desk of every engineer on the Flash team. Many of our engineers here were already looking forward to this new book, Essential ActionScript 2.0 , before it shipped. And with good reason. In this volume, Moock has once again applied his insightful, conversational style to complex topics, teaching not only the syntax of ActionScript 2.0 but also the theory and principles of OOP. He has thoroughly researched the relationships between ActionScript 2.0, its predecessor, and other languages, and he illustrates their differences in precise detail. Moock's intimate familiarity with Flash and ActionScript is evident in this instructive and approachable text, which certainly is an essential companion for anyone wishing to learn and master the ActionScript 2.0 language.

Rebecca Sun
Senior Software Engineer
Macromedia Flash Team
March 2004
 <  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