03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

See also<br />

allowDomain (security.allowDomain method)<br />

loadPolicyFile (security.loadPolicyFile method)<br />

public static loadPolicyFile(url:String) : Void<br />

Loads a cross-domain policy file from a location specified by the url parameter. Flash Player<br />

uses policy files as a permission mechanism to permit Flash movies to load data from servers<br />

other than their own.<br />

Flash Player 7.0.14.0 looked for policy files in only one location: /crossdomain.xml on the<br />

server to which a data-loading request was being made. For an XMLSocket connection<br />

attempt, Flash Player 7.0.14.0 looked for /crossdomain.xml on an HTTP server on port 80 in<br />

the subdomain to which the XMLSocket connection attempt was being made. Flash Player<br />

7.0.14.0 (<strong>and</strong> all earlier players) also restricted XMLSocket connections to ports 1024 <strong>and</strong><br />

later.<br />

With the addition of System.security.loadPolicyFile(), Flash Player 7.0.19.0 can load<br />

policy files from arbitrary locations, as shown in the following example:<br />

System.security.loadPolicyFile("http://foo.com/sub/dir/pf.xml");<br />

This causes Flash Player to retrieve a policy file from the specified URL. Any permissions<br />

granted by the policy file at that location will apply to all content at the same level or lower in<br />

the virtual directory hierarchy of the server. The following code continues the previous<br />

example:<br />

loadVariables("http://foo.com/sub/dir/vars.txt") // allowed<br />

loadVariables("http://foo.com/sub/dir/deep/vars2.txt") // allowed<br />

loadVariables("http://foo.com/elsewhere/vars3.txt") // not allowed<br />

You can use loadPolicyFile() to load any number of policy files. When considering a<br />

request that requires a policy file, Flash Player always waits for the completion of any policy<br />

file downloads before denying a request. As a final fallback, if no policy file specified with<br />

loadPolicyFile() authorizes a request, Flash Player consults the original default location, /<br />

crossdomain.xml.<br />

Using the xmlsocket protocol along with a specific port number, lets you retrieve policy files<br />

directly from an XMLSocket server, as shown in the following example:<br />

System.security.loadPolicyFile("xmlsocket://foo.com:414");<br />

security (System.security) 541

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!