System.security.loadpolicyfile() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

System.security.loadPolicyFile()

Availability
Flash Player 7 (7.0.19.0)
Usage
System.security.loadPolicyFile(url:String) : Void
Parameters
A string; the URL where the cross-domain policy file to be loaded is located.
url
Returns
Nothing.
Description
Method; loads a cross-domain policy file from a location specified by the
Player uses policy files as a permission mechanism to permit Flash movies to load data from
servers other than their own.
Flash Player 7.0.14.0 looked for policy files in only one location: /crossdomain.xml on the server
to which a data-loading request was being made. For an XMLSocket connection attempt, Flash
Player 7.0.14.0 looked for /crossdomain.xml on an HTTP server on port 80 in the subdomain to
which the XMLSocket connection attempt was being made. Flash Player 7.0.14.0 (and all earlier
players) also restricted XMLSocket connections to ports 1024 and higher.
With the addition of System.security.loadPolicyFile(), Flash Player 7.0.19.0 can load policy files
from arbitrary locations, as shown in the following example:
System.security.loadPolicyFile("http://foo.com/sub/dir/pf.xml");
This causes Flash Player to retrieve a policy file from the specified URL. Any permissions granted
by the policy file at that location will apply to all content at the same level or lower in the virtual
directory hierarchy of the server. The following code continues the previous example:
loadVariables("http://foo.com/sub/dir/vars.txt") // allowed
loadVariables("http://foo.com/sub/dir/deep/vars2.txt") // allowed
loadVariables("http://foo.com/elsewhere/vars3.txt") // not allowed
You can load any number of policy files using
that requires a policy file, Flash Player always waits for the completion of any policy file
downloads before denying a request. As a final fallback, if no policy file specified with
loadPolicyFile()
/crossdomain.xml.
Using the
xmlsocket
directly from an XMLSocket server, as shown in the following example:
System.security.loadPolicyFile("xmlsocket://foo.com:414");
848
Chapter 2: ActionScript Language Reference
authorizes a request, Flash Player consults the original default location,
protocol along with a specific port number, lets you retrieve policy files
. When considering a request
loadPolicyFile()
parameter. Flash
url

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents