Loadpolicyfile (Security.loadpolicyfile Method) - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

Example
In the following example, you host a math test on a secure domain so that only registered
students can access it. You have also developed a number of SWF files that illustrate certain
concepts, which you host on an insecure domain. You want students to access the test from
the SWF file that contains information about a concept.
// This SWF file is at https://myEducationSite.somewhere.com/mathTest.swf
// Concept files are at http://myEducationSite.somewhere.com
System.security.allowInsecureDomain("myEducationSite.somewhere.com");
See also
allowDomain (security.allowDomain method)

loadPolicyFile (security.loadPolicyFile method)

public static loadPolicyFile(url:String) : Void
Loads a cross-domain policy file from a location specified by the
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
later.
With the addition of
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
System.security.loadPolicyFile()
parameter. Flash Player
url
, Flash Player 7.0.19.0 can load
security (System.security)
573

Advertisement

Table of Contents
loading

Table of Contents