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;
NOT
E
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
.
Содержание 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...