0

I am running trying to access form my local server a remote server.

Error #2044: SecurityErrorEvent : text=Error #2048: security sandbox : http://mydomain1.com/debaton/debaton.swf cannot access data from http://mydomain2.com/~debaton/services/gateway.php.

So I put crossdomain on http://mydomain2.com/~debaton/crossdomain.xml

<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*" />

</cross-domain-policy>

and put

 params.allowscriptaccess = "always";

in my HTML.

But still has this error! What am I doing wrong ?

mkj
  • 2,761
  • 5
  • 24
  • 28
yarek
  • 11,278
  • 30
  • 120
  • 219

2 Answers2

1

Unfortunately, crossdomain.xml needs to be at the root of the domain. According to Adobe's KB - Cross-domain policy for Flash movies:

Cross-domain policy files, named crossdomain.xml, are placed at the root level of a server.

Tianzhen Lin
  • 2,404
  • 1
  • 19
  • 19
  • +1 good catch; although I think that is not universal. There are ways to put a crossdomain in subdirectories. http://stackoverflow.com/questions/8766688/how-to-add-crossdomain-xml-in-sub-directory – JeffryHouser Jul 11 '12 at 18:12
1

Flash player will load the crossdomain.xml file from the root of the web server by default. If you want to load it from a subfolder you need to load it explicitly with:

import flash.system.Security;

Security.loadPolicyFile('http://mydomain2.com/~debaton/crossdomain.xml');

There is some more information on the live docs.

mamapitufo
  • 4,680
  • 2
  • 25
  • 19