User Guide

24 Chapter 2: ActionScript Basics
Differences between ActionScript and JavaScript
ActionScript is similar to the core JavaScript programming language. You dont need to know
JavaScript to use and learn ActionScript; however, if you know JavaScript, ActionScript will
seem familiar.
This manual does not attempt to teach general programming. There are many resources that
provide more information about general programming concepts and the JavaScript language.
The European Computers Manufacturers Association (ECMA) document ECMA-262 is
derived from JavaScript and serves as the international standard for the JavaScript language.
ActionScript is based on the ECMA-262 specification. For more information, see www.ecma-
international.org/publications/standards/Ecma-262.htm).
Netscape DevEdge Online has a JavaScript Developer Central site (http://
developer.netscape.com/tech/javascript/index.html) that contains documentation and articles
useful for understanding ActionScript. The most valuable resource is the Core JavaScript Guide.
The Java Technology site has tutorials on object-oriented programming (http://java.sun.com/
docs/books/tutorial/java/index.html) that are targeted for the Java language but are useful for
understanding concepts that you can apply to ActionScript.
Some of the differences between ActionScript and JavaScript are described in the following list:
ActionScript does not support browser-specific objects such as Document, Window,
and Anchor.
ActionScript does not completely support all the JavaScript built-in objects.
ActionScript does not support some JavaScript syntax constructs, such as statement labels.
In ActionScript, the eval() function can perform only variable references.
ActionScript 2.0, the latest version of the ActionScript language, supports several features that
are not in the ECMA-262 specification, such as classes and strong typing. Many of these
features are modeled after the ECMAScript 4 Draft Proposal currently in development by
ECMA TC39-TG1 (see www.mozilla.org/js/language/es4/index.html), the standards
committee in charge of the evolution of the ECMA-262 specification.
ActionScript does not support regular expressions using the RegExp object. However,
Macromedia Central does support the RegExp object.
Terminology
As with all scripting languages, ActionScript uses its own terminology. The following list provides
an introduction to important ActionScript terms:
Boolean is a true or false value.
Classes are data types that you can create to define a new type of object. To define a class,
you use the
class keyword in an external script file (not in a script you are writing in the
Actions panel).
Constants are elements that dont change. For example, the constant Key.TAB always has the
same meaning: it indicates the Tab key on a keyboard. Constants are useful for comparing values.