Answer the question
In order to leave comments, you need to log in
How to solve the problem with crossdomain?
Hi all. There is the following structure:
Server, it has the necessary information
on port 80. On the same server there is html + swf, the flash application inside connects to its own host on port 80 and somehow processes the data
Now I try to load this application in the browser and I get error #2048, which is logical, because the flash drive is started from my computer.
I tried to create a crossdomain.xml in the root directory of the server with the text:
Code in flash:
When embedding swf, I specified: allowscriptacces="always". I don't understand what is still wrong?
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
public function connect(url:String):void {
Security.allowDomain("*");
Security.loadPolicyFile("http://SERVER/crossdomain.xml");
// И далее сама работа через сокеты
_socket = new Socket();
_socket.connect(url, 80);
}
Answer the question
In order to leave comments, you need to log in
I dare to suggest that "allowscriptacces" is misspelled. Try "allowscriptaccess", you may not immediately notice the missing letter s at the end
Are you testing in Opera? She had problems with such access from the localhost.
I don’t understand anything in flash, but I did a socket - a server. When connecting, the client sends a request for a policy file, which I sent as the first packet from the server via xmlsocket. Apparently, http also provides for such a construction.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question