0

I've created a flash site with a simple hit to a server to pull down search data. The server is a client server, located on another domain, so I created a crossdomain.xml to load at their root.

I kept getting sandbox security errors, so I ran Charles and found that my code is requesting a crossdomain.xml after the urlVariables.

For example. I call

http://searchStuff.com/search?master_device_id=5606&q=email&do=simulator_sayt

And my program looks for the crossdomain.xml here:

http://searchStuff.com/search?master_device_id=5606&q=email&do=simulator_sayt/crossdomain.xml

I've tried using Security.loadPolicyFile, but this doesn't work until it hits the crossdomain.xml at the root (which it is clearly looking for in the wrong place).

I've tried using POST and GET methods, setting the URLRequest.data method and just appending the variables as a string to the original URL. The same problem keeps occurring.

Any insight on what might cause this?

4

2 回答 2

0

您可以在源代码中指定绝对路径:

flash.system.Security.loadPolicyFile("{http://domain.com/crossdomain.xml}");
于 2011-03-01T14:48:54.107 回答
0

嗯,我想通了。事实证明你必须在“?”之前有“/”,

即:我使用的网址如下所示:

http://searchStuff.com/search?master_device_id=5606&q=email&do=simulator_sayt

但它需要看起来像这样

http://searchStuff.com/search/?master_device_id=5606&q=email&do=simulator_sayt

这解决了问题。

于 2011-03-03T14:21:21.217 回答