Chapter 2: Flash ActionScript


Overview

As we've already seen, the Flash authoring tool is a powerful device that we can use to quickly and easily create movies and animation in a "ready for the Web" format. Although that's all well and good, our goal of creating video games requires more power than the authoring tool provides. What we really need to do is monitor what the user is doing and then react in an appropriate way. This interactivity with the user can only be achieved with the use of a programming language, and in this case, the language is ActionScript.

ActionScript is now divided into two versions: ActionScript 1.0 (AS 1.0) and ActionScript 2.0 (AS 2.0). For the most part, these are the same languages; however, AS 2.0 adds case sensitivity and new compile-time checks when dealing with classes.

Both versions of ActionScript are conveniently based on the ECMAScript standard (ECMA-262). ActionScript 2.0 is an implementation of the ECMA 4 proposal. The ECMAScript standard is based on C++ syntax and as such, the programming community quickly accepted it. Further, JavaScript is also based on ECMA-262, which makes it extremely portable to and from ActionScript. When you first learn that all these languages share syntax, you might think, "Gee, if I learn more than one, I'll start to get confused about the differences." In fact, the contrary is true. Because there is so much shared between the languages, programmers who are already comfortable in one language will find the transition to another almost effortless.

Now that we know what ActionScript is, let's learn a little about what it can do and how it works. To be able to program, we need a place to actually type in the script. Flash gives us a tool for doing just that, and it's called the Actions panel.




Macromedia Flash MX 2004 Game Programming
Macromedia Flash MX 2004 Game Programming (Premier Press Game Development)
ISBN: 1592000363
EAN: 2147483647
Year: 2004
Pages: 161

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