yarek
yarek

Reputation: 12054

Flex simple corssdomain access

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 ?

Upvotes: 0

Views: 67

Answers (2)

mamapitufo
mamapitufo

Reputation: 4810

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.

Upvotes: 1

Tianzhen Lin
Tianzhen Lin

Reputation: 2624

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.

Upvotes: 1

Related Questions