0

So I've tried pretty much every method I can think of and either get a 404 on the status when testing in offline mode or get a security sandbox error when testing online. I'm attempting to fetch data from a shoutcast page using the 7.html that it has for quick access to the stats. The page I'm testing with is http://37.58.52.41/7.html

Note: I've tried the netstream method of fetching shoutcast data and was unsuccessful with that as well.

Zoltea
  • 33
  • 2
  • from what I can see, there is not crossdomain.xml on 37.58.52.41. If there is no crossdomain, you won't be able to directly download files from this server. – Aralicia Aug 05 '13 at 16:01

2 Answers2

0

Maybe the following code will be useful:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">
    <mx:Script>
        <![CDATA[
            private function init():void{
                var loader:URLLoader = new URLLoader();
                loader.addEventListener(Event.COMPLETE, urlloaderCallback);
                var header:URLRequestHeader = new URLRequestHeader("pragma", "no-cache");
                var request:URLRequest = new URLRequest("http://37.58.52.41/7.html");
                request.requestHeaders.push(header);
                loader.load(request); 
            }
            public function urlloaderCallback(event:Event):void{
                //<HTML><meta http-equiv="Pragma" content="no-cache"></head><body>531,1,893,1000,528,192,We aRe oNe</body></html>
                var get:String = event.currentTarget.data;
            }
        ]]>
    </mx:Script>
</mx:Application> 

This code works perfectly, check the comment below public function urlloaderCallback, there is the HTML returned by the URLLOAD call.

Gaston Flores
  • 2,457
  • 3
  • 23
  • 42
0

As @Aralicia pointed out, you need a crossdomain policy on the server that allows Flash to pull information from it.

A cross-domain policy file is an XML document that grants a web client, such as Adobe Flash Player or Adobe Acrobat (though not necessarily limited to these), permission to handle data across domains. When clients request content hosted on a particular source domain and that content make requests directed towards a domain other than its own, the remote domain needs to host a cross-domain policy file that grants access to the source domain, allowing the client to continue the transaction.

Marty
  • 39,033
  • 19
  • 93
  • 162