MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH Manual page 700

Learning actionscript 2.0 in flash
Table of Contents

Advertisement

The SWF files are not in the same domain (for example, one file is at www.domain.com
and one is at store.domain.com).
You must make the following changes:
If the called SWF file is published for Flash Player 7 or later, include
System.security.allowDomain
file, using exact domain-name matching.
If the called SWF file is published for Flash Player 6, modify the called file to add or
change a
System.security.allowDomain
statement, using exact domain-name matching, as shown in the code examples earlier in
this section. You can publish the modified file for either Flash Player 6 or 7.
If the called SWF file is published for Flash Player 5 or earlier, port the called file to
Flash Player 6 or 7 and add a
domain-name matching, as shown in the code examples earlier in this section.
(LocalConnection objects aren't supported in Flash Player 5 or earlier.)
For information on local security sandboxes, see
on page
679.
Allowing data access between cross-domain
SWF files
For two SWF files to access each other's data (variables and objects), the two files must
originate from the same domain. By default, in Flash Player 7 and later, the two domains
must match exactly for the two files to share data. However, a SWF file can grant access to
SWF files served from specific domains by calling
System.security.allowDomain()
System.security.allowDomain()
access objects and variables in the SWF file that contains the
If two SWF files are served from the same domain—for example, http://mysite.com/
movieA.swf and http://mysite.com/movieB.swf—then movieA.swf can examine and modify
variables, objects, properties, methods, and so on in movieB.swf, and movieB can do the same
for movieA. This is called cross-movie scripting, or cross-scripting.
If two SWF files are served from different domains—for example, http://mysite.com/
movieA.swf and http://othersite.com/movieB.swf—then, by default, Flash Player does not
allow movieA.swf to script movieB.swf, nor movieB to script movieA. If you call
System.security.allowDomain("mysite.com")
to script movieB.swf. A SWF file gives SWF files from other domains permission to script it
by calling
System.security.allowDomain()
700
Understanding Security
or
LocalConnection.allowDomain
or
LocalConnection.allowDomain
System.security.allowDomain
"About local file security and Flash Player"
LocalConnection.allowDomain
.
lets SWF files and HTML files in specified domains
, movieB.swf gives movieA.swf permission
. This is called cross-domain scripting.
in the called SWF
statement, using exact
call.
allowDomain()
or

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents