Porting existing scripts to Flash Player 7
15
You might also need to implement a policy file if you are using runtime shared libraries. If either
the loading or loaded SWF file is published for Flash Player 7 and the loading and loaded files
aren’t served from the exact same domain, use a policy file to permit access. For more information
on policy files, see
“About allowing cross-domain data loading” on page 190
.
Porting existing scripts to Flash Player 7
As with any new release, Flash Player 7 supports more ActionScript commands than previous
versions of the player; you can use these commands to implement more robust scripts. (See
“New
and changed language elements” on page 13
.)However, if you used any of these commands in
your existing scripts, the script might not work correctly if you publish it for Flash Player 7.
For example, if you have a script with a function named Error, the script might appear to compile
correctly but might not run as expected in Flash Player 7, because Error is now a built-in class
(and thus a reserved word) in ActionScript. You can fix your script by renaming the Error
function to something else, such as ErrorCondition.
Also, Flash Player 7 implements a number of changes that affect how one SWF file can access
another SWF file, how external data can be loaded, and how local settings and data (such as
privacy settings and locally persistent shared objects) can be accessed. Finally, the behavior of
some existing features has changed.
If you have existing scripts written for Flash Player 6 or earlier that you want to publish for Flash
Player 7, you might need to modify the scripts so they conform with the implementation of Flash
Player 7 and work as designed. These modifications are discussed in this section.
ECMA-262 Edition 4 compliance
Several changes have been implemented in Flash Player 7 to conform more closely to the
ECMA-262 Edition 4 proposal (see
www.mozilla.org/js/language/es4/index.html
). In addition to
the class-based programming techniques available in ActionScript 2.0 (see
“New object-oriented
programming model” on page 22
), other features have been added and certain behaviors have
changed. Also, when publishing for Flash Player 7 and using ActionScript 2.0, you can cast one
object type to another. For more information, see
“Casting objects” on page 39
. These capabilities
don’t require you to update existing scripts; however, you may want to use them if you publish
your scripts to Flash Player 7 and then continue to revise and enhance them.
Содержание FLASH MX 2004 - ACTIONSCRIPT
Страница 1: ...ActionScript Reference Guide...
Страница 8: ...8 Contents...
Страница 12: ......
Страница 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Страница 54: ...54 Chapter 2 ActionScript Basics...
Страница 80: ...80 Chapter 3 Writing and Debugging Scripts...
Страница 82: ......
Страница 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Страница 112: ......
Страница 120: ...120 Chapter 6 Using the Built In Classes...
Страница 176: ......
Страница 192: ...192 Chapter 10 Working with External Data...
Страница 202: ...202 Chapter 11 Working with External Media...
Страница 204: ......
Страница 782: ...782 Chapter 12 ActionScript Dictionary...
Страница 793: ...Other keys 793 221 222 Key Key code...
Страница 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Страница 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Страница 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Страница 816: ...816 Index...