Cross-domain policy issues after redirect in Flash

Posted by ggambett on Stack Overflow See other posts from Stack Overflow or by ggambett
Published on 2010-04-29T19:44:33Z Indexed on 2010/04/29 19:47 UTC
Read the original article Hit count: 581

Filed under:
|
|
|

I'm having trouble with a cross-domain policy. I'm using the AS3 Loader to fetch an image; I'm making it load the policy file, like this :

var pLoader : Loader = new Loader();            

var pContext : LoaderContext = new LoaderContext();
pContext.checkPolicyFile = true;

pLoader.load(new URLRequest(sURL), pContext);

This works fine as long as the image is directly accessible; however, when the server sends a redirect, the loader follows it but loses the checkPolicyFile flag, resulting in a SecurityException - that is, it doesn't check the cross-domain policy of the redirected URL.

I've found a solution here ( http://www.stevensacks.net/2008/12/23/solution-as3-security-error-2122-with-300-redirects ) but looks fragile (that is, looks like it will fail if there's more than one redirect). What would be the correct way of doing this?

© Stack Overflow or respective owner

Related posts about cross-domain

Related posts about as3