Flash not even requesting crossdomain.xml

2019-09-03 16:26发布

问题:

I have a swf hosted at a.domain.com:

  • Embed the player on a.domain.com: Flash player loads, sends loaded callback, have camera access
  • Embed the player on b.domain.com: Flash player loads, no javascript callbacks, no camera access

My a.domain.com/crossdomain.xml file:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="all"/>
  <allow-access-from domain="*.domain.com" secure="false"/>
  <allow-http-request-headers-from domain="*.domain.com" headers="*" secure="false"/>
</cross-domain-policy>

Problem is, the crossdomain.xml file is never requested when embedded on a different subdomain.

What in the heck is going on here?

回答1:

I think that you maybe got a security error, to verify that, try your swf using a flash player debug version that you can download here : Adobe.com : Flash Player Downloads.

And to avoid that error, you can try to use this :

  • In your ActionScript code : Security.allowDomain('*');
  • In your swf object HTML embed code : <param name="allowscriptaccess" value="always"/>.