67
3
CHAPTER 3
About ActionScript
The object-oriented programming (OOP) features in ActionScript 2.0 are based on the
ECMAScript 4 Draft Proposal currently in development by ECMA TC39-TG1 (see
www.mozilla.org/js/language/es4/index.html
). Because the ECMA-4 proposal is not yet a
standard, and because it is still changing, ActionScript 2.0 is loosely based on this
specification.
ActionScript 2.0 supports all the standard elements of the ActionScript language; it lets you
write scripts that more closely adhere to standards used in other object-oriented languages,
such as Java. ActionScript 2.0 should be of interest primarily to intermediate or advanced
Flash developers who are building applications that require the implementation of classes and
subclasses. ActionScript 2.0 also lets you declare the object type of a variable when you create
it (see
“About assigning data types and strict data typing” on page 81
) and provides
significantly improved compiler errors (see
Appendix A, “Error Messages,” on page 773
).
Key facts about ActionScript 2.0 include the following points:
■
Scripts that use ActionScript 2.0 to define classes or interfaces must be stored as external
script files, with a single class defined in each script; that is, classes and interfaces cannot
be defined in the Actions panel.
■
You can import individual class files implicitly (by storing them in a location specified by
global or document-specific search paths and then using them in a script) or explicitly (by
using the
import
command); you can import packages (collections of class files in a
directory) by using wildcards.
■
Applications developed with ActionScript 2.0 are supported by Flash Player 6 and later.
For more information on using ActionScript 2.0 to write object-oriented programs in Flash,
see
Chapter 7, “Classes,” on page 225
.
CAU
T
ION
The default publish setting for new files created in Flash 8 is ActionScript 2.0. If you
plan to modify an existing FLA file with ActionScript 1.0 to use ActionScript 2.0
syntax, ensure that the FLA file specifies ActionScript 2.0 in its publish settings. If it
does not, your file will compile incorrectly, although Flash will not necessarily
generate compiler errors.
Содержание FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Страница 1: ...Learning ActionScript 2 0 in Flash...
Страница 8: ...8 Contents...
Страница 18: ...18 Introduction...
Страница 30: ...30 What s New in Flash 8 ActionScript...
Страница 66: ...66 Writing and Editing ActionScript 2 0...
Страница 328: ...328 Interfaces...
Страница 350: ...350 Handling Events...
Страница 590: ...590 Creating Interaction with ActionScript...
Страница 710: ...710 Understanding Security...
Страница 730: ...730 Debugging Applications...
Страница 780: ...780 Deprecated Flash 4 operators...
Страница 830: ...830 Index...