开发者

System.security.loadPolicyFile not loading from the custom location (Flash AS 2)

开发者 https://www.devze.com 2023-01-24 13:22 出处:网络
All, I\'m trying to load a cross-domain policy file from a custom location (instead of the root). Specifically, the developer of a web service I\'m trying to call has installed a cross-domain policy

All,

I'm trying to load a cross-domain policy file from a custom location (instead of the root).

Specifically, the developer of a web service I'm trying to call has installed a cross-domain policy file on his server at:

http://[web_service_domain]/[some_subdirectory]/crossdomain.xml

So, in my SWF, I'm calling this:

System.security.loadPolicyFile("http://[web_service_domain]/[some_subdirectory]/crossdomain.xml";

However, when I run test that SWF in the Flash IDE, I get this error:

Error opening URL 'http://[web_service_domain]/crossdomain.xml'

In other words, the loadPolicyFile command is ignoring the [some_subdirectory], and attempting to load the policy file from the root.

Of course, it's not there, so it fails to load. (If the developer could install the file at the root, I wouldn't have this problem, so I wouldn't be using System.security.loadPolicyFile in the first place).

It's not just in the IDE - when I test the app in Firefox with Firebug, I can see that the SWF is attempting to load the policy file from 'http://[web_service_domain]/crossdomain.xml'.

I've stripped down the SWF so that it does nothing else but attempt to load the policy file from the subdirectory, and it still fails. So, I don't think this has to do with any idiosyncrasies of my specific app.

Bottom line - does the S开发者_Python百科ystem.security.loadPolicyFile work? Is there something else I need to do in conjunction with that call to get it to work? Or, is there something I'm doing wrong?

Many thanks in advance for any advice/insight.


It is trying to load the master crossdomain policy file which is now required: http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号