Playdome.io
Playdome.io

Reputation: 3225

AS3 is not loading crossdomain.xml

I have this code:

var advert:Loader = new Loader();
var url:URLRequest = new URLRequest(root.loaderInfo.parameters.video_src);
var context:LoaderContext = new LoaderContext();
context.checkPolicyFile = true;
context.securityDomain = SecurityDomain.currentDomain;
context.applicationDomain = ApplicationDomain.currentDomain;
advert.load(url, context);

For some reason there is no packet at all for the crossdomain.xml query

Also i get this error:

Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://edomain.com/flashfile.swf?t=1413815793214 cannot load data from

And this is the crossdomain that should be loaded:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <site-control permitted-cross-domain-policies="master-only"/>
    <allow-access-from domain="*" />
</cross-domain-policy>

Upvotes: 0

Views: 108

Answers (1)

Zephyrus
Zephyrus

Reputation: 26

have you tried using an URLLoader to download the SWF and use loadBytes on the Loader with the data returned? That way you can bypass the securityDomain check and still force it to use SecurityDomain.currentDomain (as that's what used for loadBytes and can't even be changed)

Upvotes: 1

Related Questions