connect so:

Security.allowDomain('http://85.95.163.90'); Security.loadPolicyFile("http://85.95.163.90/vk_pc/crossdomain.xml"); 

but

 loader.load(new URLRequest("http://85.95.163.90/vk_pc/game.php")); 

does not work.

crossdomain.xml:

 <cross-domain-policy> <allow-access-from domain="*" /> </cross-domain-policy> 

what's wrong?

UPD:

alt text

  • So you are not working with the browser? - ShockWave
  • If you run SWF on the desktop, it is better to collect the AIR application, there are no restrictions on cross-domain security policy. - ShockWave
  • I'm just a test here because it displays information about the error. And in the browser simply does not load the data. - Ilya Chizhanov
  • The browser is not debug version, so it does not display an error. Here it outputs - oxanaratone.narod.ru/assault/test00.html This flash drive is knocking on your server and loads hml with the output, also prints errors. - ShockWave

1 answer 1

everything works, the code is:

 protected function executeTest():void { var loader:URLLoader = new URLLoader(); var req:URLRequest = new URLRequest('http://85.95.163.90/vk_pc/game.php'); loader.addEventListener (Event.COMPLETE, completeHandler, false, 0, true); loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler); loader.load (req); } protected function completeHandler(event:Event):void { trace( event.target.data ); } private function errorHandler(event:Event):void { trace("Error: " + event); } 

Also, check that the crossdomain is correct, ideally it should be like this:

 <?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <allow-access-from domain="*" to-ports="*"/> </cross-domain-policy>