1

I am sending http request to server via URLLoader in Flash. My Code is:

var urlLoader:URLLoader=new URLLoader();
var urlRequest:URLRequest=new URLRequest();
var urlparam:URLVariables= new URLVariables();
urlparam.req=JSON.encode(workout);
urlRequest.method="POST";
urlRequest.data=urlparam;
urlRequest.url="http://mydomain.com/saveworkout.php";
urlLoader.addEventListener(Event.COMPLETE,loadCompleted);
urlLoader.addEventListener(IOErrorEvent.IO_ERROR,loadError);
urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR,securityError);
urlLoader.load(urlRequest);

}

private function loadError(event:IOErrorEvent):void{
    trace("Stream Error="+event.text);


    }
    private function securityError(event:SecurityErrorEvent):void{
        trace("Security Error="+event.text);

        }
private function loadCompleted(event:Event):void{
    var urlLoader:URLLoader=event.target as URLLoader;
    trace(urlLoader.data);


    }

This code works fine when I test it locally and send request to localhost, but giving me Error #2032: Stream Error. At remote server codeigniter framework is being used. I also the crossdomain.xml in the httpdocs directory, and also cross check the request url. Request url opens fine directly in the web browsers. Any idea?

Thanks & Regards,

RAS
  • 8,100
  • 16
  • 64
  • 86
flash_flip
  • 41
  • 5
  • If you Google "Error #2032: Stream Error", there are quite a few suggestions. Can you see if any of those solutions fix it? If not, please add to your question with the tests you tried, and any relevant results. – iND Jan 04 '12 at 02:01

1 Answers1

0

Check headers in server response.

Maybe it's not of right MIME type or even corrupt.

Browser show it's ok, but in reality its broken. Use Firebug, or Tamperdata plugin for Firefox.

Stephan
  • 41,764
  • 65
  • 238
  • 329
victor k
  • 23
  • 4