Skip to main content
Participating Frequently
July 10, 2008
Question

Security.loadPolicyFile

  • July 10, 2008
  • 1 reply
  • 286 views
Hello
If i need to load media content(gif, jpg files) from two different domains can I load two different crossdomain.xml from there?
For example:
Security.loadPolicyFile(" http://domain1/crossdomain.xml");
Security.loadPolicyFile(" http://domain2/crossdomain.xml");
and after that:
var context:LoaderContext = new LoaderContext();
context.checkPolicyFile = true;
request = new URLRequest(" http://domain1/qaz.gif");
loader.load(request, context);
...
request = new URLRequest(" http://domain2/wsx.gif");
loader.load(request, context);
Will it work?

Thanks
This topic has been closed for replies.

1 reply

Inspiring
July 10, 2008
Based on what you describe, that should work ok, yes, at least it has when I've done it. If the Security.loadPolicyFile is issued before any loading requests to the foreign domain, then a subsequent request shouldn't be denied before flash has attempted to access the policyfile, and will only be denied after that if permission is not granted.