User Guide
Porting existing scripts to Flash Player 7 19
• If the called file is published for Flash Player 6 or earlier, and both the calling and called files
are in same domain (for example, a file in http://www.domain.com is calling a file in https://
www.domain.com), no modification is needed.
• If the called file is published for Flash Player 6, the files are not in same domain, and you don’t
want to port the called file to Flash Player 7, modify the called file to add or change a
System.security.allowDomain or LocalConnection.allowDomain statement, using exact
domain-name matching, as shown in the code examples earlier in this section.
• If the called file is published for Flash Player 6 and you want to port the called file to Flash
Player 7, include
System.security.allowInsecureDomain or
LocalConnection.allowInsecureDomain in the called file, using exact domain-name
matching, as shown in the code examples earlier in this section. This statement is required even
if both files are in same domain.
• If the called file is published for Flash Player 5 or earlier, and both files are not in the same
domain, you can do one of two things. You can either port the called file to Flash Player 6 and
add or change a
System.security.allowDomain statement, using exact domain-name
matching, as shown in the code examples earlier in this section, or you can port the called file
to Flash Player 7, and include a
System.security.allowInsecureDomain statement in the
called file, using exact domain-name matching, as shown in the code examples earlier in
this section.
Server-side policy files for permitting access to data
A Flash document can load data from an external source by using one of the following data
loading calls:
XML.load(), XML.sendAndLoad(), LoadVars.load(),
LoadVars.sendAndLoad(), loadVariables(), loadVariablesNum(),
MovieClip.loadVariables()
, XMLSocket.connect(), and Macromedia Flash Remoting
(
NetServices.createGatewayConnection). Also, a SWF file can import runtime shared
libraries (RSLs), or assets defined in another SWF file, at runtime. By default, the data or RSL
must reside in the same domain as the SWF file that is loading that external data or media.
To make data and assets in runtime shared libraries available to SWF files in different domains,
you should use a cross-domain policy file. A cross-domain policy file is an XML file that provides a
way for the server to indicate that its data and documents are available to SWF files served from
certain domains, or from all domains. Any SWF file that is served from a domain specified by the
server’s policy file is permitted to access data or RSLs from that server.
If you are loading external data, you should create policy files even if you don’t plan to port any
files to Flash Player 7. If you are using RSLs, you should create policy files if either the calling or
called file is published for Flash Player 7.
For more information, see “About allowing cross-domain data loading” on page 290.