MACROMEDIA FLASH MX 2004-USING ACTIONSCRIPT IN FLASH Use Manual page 292

Using actionscript in flash
Hide thumbs Also See for FLASH MX 2004-USING ACTIONSCRIPT IN FLASH:
Table of Contents

Advertisement

A policy file that contains no
policy on a server.
About custom policy file locations
Flash Player 7 (7.0.19.0) supports a new method called
This method lets you specify a custom location on a server where a cross domain policy file can be
found, so it does not need to be in the root directory. Flash Player 7 (7.0.14.0) only searched for
policy files in the root location of a server, but it can be inconvenient for a site administrator to
place this file in the root directory. For more information on the
XMLSocket connections, see
System.security.loadPolicyFile
If you use the
loadPolicyFile
directory, as long as the SWF files that need to use the policy file call
Flash Player where the policy file is located. However, policy files not placed in the root directory
have a limited scope. The policy file only allows access to locations at or below its own level in the
server's hierarchy.
The
loadPolicyFile
SWF files using the
Require Flash Player 7 (7.0.19.0) or later.
Arrange for the site where the data is coming from to have a policy file in the default location
(the root directory) as well as in the non-default location. Earlier versions of Flash Player will
use the default location.
Otherwise, authors must create SWF files so a failure of a cross-domain loading operation is
implemented.
Caution: If your SWF file relies on loadPolicyFile, visitors with Flash Player 6 or earlier or Flash Player
(7.0.19.0)
7
or later will not have problems. However, visitors with Flash Player
have support for loadPolicyFile.
If you want to use a policy file in a custom location on the server, you must call
System.security.loadPolicyFile
such as the following:
System.security.loadPolicyFile
("http://www.foo.com/folder1/folder2/crossdomain.xml");
var my_xml:XML = new XML();
my_xml.load("http://www.foo.com/folder1/folder2/myData.xml");
You can load several policy files with overlapping scopes using
Flash Player tries to consult all the files whose scope includes the location of the request. If one
policy file fails to grant cross domain access, another file is not prevented from granting access to
data. If all access attempts fail, Flash Player looks in the default location of the crossdomain.xml
file (in the in the root directory). The request fails if no policy file is found in the default location.
292
Chapter 11: Working with External Data
<allow-access-from>
"About XMLSocket policy files" on page 293
in Flash ActionScript Language Reference.
method, a site administrator can place the policy file in any
method is available only in Flash Player 7 (7.0.19.0) or greater. Authors of
method must do one of the following:
loadPolicyFile
before you make any requests that depend on the policy file,
tags has the same effect as not having a
System.security.loadPolicyFile
loadPolicyFile
and
loadPolicyFile
loadPolicyFile
.
method and
to tell
7 (7.0.14.0)
will not
. For all requests,

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING ACTIONSCRIPT IN FLASH and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx 2004 - actionscript

Table of Contents