18
Chapter 1: What’s New in Flash MX 2004 ActionScript
Because Flash Player 7 implements exact-domain matching rules instead of superdomain
matching rules, you might have to modify existing scripts if you want to access them from files
that are published for Flash Player 7. (You can still publish the modified files for Flash Player 6.)
If you used any
LocalConnection.allowDomain()
or
System.security.allowDomain()
statements in your files and specified superdomain sites to permit, you must change your
parameters to specify exact domains instead. The following code shows an example of the kinds of
changes you might have to make:
// Flash Player 6 commands in a SWF file at www.anyOldSite.com
// to allow access by SWF files that are hosted at www.someSite.com
// or at store.someSite.com
System.security.allowDomain("someSite.com");
my_lc.allowDomain = function(sendingDomain) {
return(sendingDomain=="someSite.com");
}
// Corresponding commands to allow access by SWF files
// that are published for Flash Player 7
System.security.allowDomain("www.someSite.com", "store.someSite.com");
my_lc.allowDomain = function(sendingDomain) {
return(sendingDomain=="www.someSite.com" ||
sendingDomain=="store.someSite.com");
}
You might also have to add statements like these to your files if you aren’t currently using them.
For example, if your SWF file is hosted at www.someSite.com and you want to allow access by a
SWF file published for Flash Player 7 at store.someSite.com, you must add statements like the
following to the file at www.someSite.com (you can still publish the file at www.someSite.com for
Flash Player 6):
System.security.allowDomain("store.someSite.com");
my_lc.allowDomain = function(sendingDomain) {
return(sendingDomain=="store.someSite.com");
}
To summarize, you might have to modify your files to add or change
allowDomain
statements if
you publish files for Flash Player 7 that meet the following conditions:
•
You implemented cross-SWF scripting (using
loadMovie()
,
MovieClip.loadMovie()
,
MovieClipLoader.LoadClip()
, or Local Connection objects).
•
The called SWF file (of any version) is not hosted at a site using a secure protocol (HTTPS), or
the calling and called SWF files are both hosted at HTTPS sites. (If only the called SWF file is
HTTPS, see
“HTTP to HTTPS protocol access between SWF files” on page 19
.)
•
The SWF files are not in same domain (for example, one file is at www.domain.com and one is
at store.domain.com).
Содержание 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...