Table B-1 reflects important intentional differences between Flash ActionScript 2.0 and the ECMAScript Edition 4 standard (available at: http://www.mozilla.org/js/language/es4). At the time of writing, the ECMAScript Edition 4 specification is still very much under development; hence, additional important differences may not be listed here, and certainly many minor differences are not listed. Most of ActionScript 2.0's divergences from the ECMAScript Edition 4 standard are the result of either the standard's ongoing volatility or an architectural limitation imposed by the Flash Player platform. Finally, Table B-1 does not reflect any bugs that may exist in ActionScript's implementation of the standard. Table B-1. Differences between ECMAScript Edition 4 and ActionScript 2.0 Topic | Description | Code in class definition block | In ActionScript 2.0, class definition blocks can contain only variable and function definitions. In ECMAScript 4, "A Class Definition's Block is evaluated just like any other Block, so it can contain expressions, statements, loops , etc. Such statements that do not contain declarations do not contribute members to the class being declared, but they are evaluated when the class is declared." | Nested classes | ActionScript 2.0 does not allow any form of nested classes. ECMAScript 4 allows a class to be defined as a static member of another class. | Class attributes | ActionScript 2.0 does not support ECMAScript 4's final class attribute, but adds its own custom attribute, intrinsic . See Chapter 4. | Method overriding | ActionScript 2.0 has no overriding restrictions. ECMAScript 4 requires an overriding method to use the override attribute and to have the same name , number of parameters, and parameter types as the overridden method. See Chapter 6. | Property enumeration | According to the ECMAScript 4 specification, instance properties should be nonenumerable unless they are defined with the enumerable attribute. In ActionScript 2.0, instance properties become enumerable once assigned a value. ActionScript 2.0 does not support the enumerable attribute. See Chapter 4. Refer to the Object.isPropertyEnumerable( ) method. | Interfaces | ECMAScript 4 does not include ActionScript 2.0's interface construct. See Chapter 8. | Member access | ActionScript 2.0 provides only two levels of member access: private and public . In ActionScript 2.0, private members are accessible to subclasses. In ECMAScript 4, members can be private , internal , or public , where internal means package access only and private means class access only (not subclass). | Packages | Packages are part of ActionScript 2.0 but were removed from the ECMAScript 4 specification due to time constraints. ActionScript 2.0's implementation of packages depends on the filesystem (like Java), not on ECMAScript 4's package statement. The semantics of the import statement in ActionScript 2.0 vary slightly from those in ECMAScript 4. See Chapter 9. | |