116 Syntax and Language Fundamentals
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 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 (ECMA-262) edition 3 language specification (see www.ecma-
international.org/publications/standards/Ecma-262.htm).
■ ActionScript does not support regular expressions using the RegExp object. However,
Macromedia Central does support the RegExp object. For more information on
Macromedia Central, see www.macromedia.com/software/central.
About case sensitivity
When you write ActionScript for Flash Player 7 and later, your code is case-sensitive. This
means that variables with slightly different capitalization are considered different from each
other. The following ActionScript code shows this:
// use mixed capitalization
var firstName:String = "Jimmy";
// use all lower case
trace(firstname); // undefined
Or you could write the following:
// In file targeting Flash Player 8
// and either ActionScript 1.0 or ActionScript 2.0
//
// Sets properties of two different objects
cat.hilite = true;
CAT.hilite = true;
// Creates three different variables
var myVar:Number = 10;
var myvar:Number = 10;
var mYvAr:Number = 10;
NOTE
It is not a good practice to differentiate between variables, or any identifier, using
different case. For more information on naming variables, see Chapter 19, “Best
Practices and Coding Conventions for ActionScript 2.0,” on page 731.