ActionScript 1.0 Versus ActionScript 2.0
The ActionScript 2.0 examples must be compiled in the Flash MX 2004
or Flash MX Professional 2004 authoring environment. To make sure the
AS 2.0 examples compile, you should set the ActionScript version to
ActionScript 2.0 under
File Publish
Settings Flash. All
examples have been tested in Flash Player 7.
In ActionScript 2.0, all custom class definitions must be placed in
external .as files. For example, the custom
Whatever class must be placed in an external
plain text file named Whatever.as (both the
capitalization of the name and the .as extension
are mandatory). You can create and edit such a file in Flash MX
Professional 2004 if you select
File
New ActionScript File. If
using Flash MX 2004, you'll need an external text
editor.
We can't give a full course on OOP and ActionScript
2.0 here, although we do try to provide pointers throughout the book.
For many more details on ActionScript 2.0 classes and object-oriented
development, see Essential
ActionScript 2.0 (O'Reilly).
Most examples can also be exported in Flash Player 6 format from
Flash MX 2004 (standard or Professional edition), by setting the
Export format to Flash Player 6 under
File Publish
Settings Flash.
However, methods that are new to Flash MX 2004 and Flash Player 7
won't work if you are exporting to Flash Player 6
format.
The previous version of the Flash authoring tool, Flash MX, does not
support ActionScript 2.0. However, many of the AS 1.0 code examples
will work in Flash MX.
In some cases, this book uses timeline-based code, which, although it
is not necessarily a best practice, is supported for both
ActionScript 1.0 and ActionScript 2.0. We made this choice when an
example didn't benefit markedly from using
ActionScript 2.0 classes. This makes the examples easier to follow
and implement in both Flash MX and Flash MX 2004.
Some of the class-based OOP examples written in ActionScript 2.0
won't compile in ActionScript 1.0 and require Flash
MX 2004 (standard or Professional edition). If you are still using
ActionScript 1.0 in Flash MX 2004, consider this an opportunity to
broaden your horizons and use AS 2.0.
 |