
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Best Practices in Flash 6 ActionScript
|
979
To run scripts in Flash Player 4, you must set the Version of your .swf
file to Flash 4 under the Flash tab under File
➝ Publish Settings. All
code is disabled if you attempt to run a Flash 5 or later .swf file in
Flash Player 4. To run scripts in Flash Player 5, you must set the Ver-
sion of your .swf file to Flash 5 under the Flash tab under File
➝ Pub-
lish Settings. All code is disabled if you attempt to run a Flash 6 or
later .swf file in Flash Player 5.
Best Practices in Flash 6 ActionScript
Very little of Flash 5 ActionScript was formally deprecated in Flash 6. The following
formal changes to the language were introduced in Flash 6:
• The eval() function cannot be used on the left side of an assignment operation.
• Function scope is defined permanently at declaration time instead of at invoca-
tion time. See “Function Scope” in Chapter 9.
The following list presents new features that are preferred over previous Flash 5
alternatives:
• Global variables should be defined on
_global, not _root or Object.
• Superclass constructors should be executed via the super operator, not a manual
reference to the superclass constructor function.
• All imported text should be in Unicode, not Latin 1 or Shift-JIS.
• Movie clip and button event handlers should ...