0
votes

My swf application at domain http://domain1.com/myroot/ must use resources from domain http://domain2.com/myroot2/

When the swf trys to access resources from secondary domain, it get SecurityError:

Error #2048: Security sandbox violation.

It appears because my application tries to load crossdomain.xml (from http:/domain2.com/crossdomain.xml) by default.

My problem is that I do not have access to domain2.com root directory to put the file crossdomain.xml there. I can put it only in http:/domain2.com/myroot2/ directory.

My question is: How to force my swf application to search crossdomain.xml in http:/domain2.com/myroot2/?

P.S. Security.loadPolicyFile("http://domain2.com/myroot2/crossdomain.xml") does not work because by default used metapolicy "master-only" that makes ignore all Security.loadPolicyFile usages.

2

2 Answers

0
votes

Flash's new sandbox security requires you to always have a crossdomain policy file on the root of the server. If you are going to put a crossdomain file in the subdirectory, the root's master crossdomain file must allow that on the server.

0
votes

loadPolicyFile should do it

Security.allowDomain( 'http://domain2.com' );
Security.loadPolicyFile( 'http://domain2.com/myroot2/pf.xml' );