title: loading Json data from server using AIR for android and flashpro
body: <p>I'm trying to load json data from a service, the application is created in flash professional cs6 using AIR for android, yet  every time I connect to the service I get a server status response of 500 hat's it, here's the code:</p>
  
  <pre><code>    import flash.net.URLVariables;
      import flash.net.URLRequest;
      import flash.events.HTTPStatusEvent;
      import flash.events.ProgressEvent;
      import flash.events.Event;
      import flash.events.SecurityErrorEvent;
      import flash.events.IOErrorEvent;
      import flash.utils.Timer;
      import flash.events.TimerEvent;
      import flash.net.URLLoaderDataFormat;
  
  
     var reqst:URLRequest = new URLRequest();
  
      function contactServer():void{
  
      var urlVar:URLVariables = new URLVariables();
      //  
  
      reqst = new URLRequest("http://xxxxxxxxx/xxxxxx.asmx?op=Login");
  
  
      urlVar.UserName = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
      urlVar.Password = "xxxxxxxxxxx";
  
  
  
      reqst.requestHeaders=[new URLRequestHeader("Content-Type", "application/json")];
  
      reqst.method = URLRequestMethod.POST;
      reqst.data = urlVar;
  
  
      var my_loader:URLLoader = new URLLoader();
      my_loader.dataFormat = URLLoaderDataFormat.TEXT;
  
      my_loader.addEventListener(Event.COMPLETE, completeHandler_);
      my_loader.addEventListener(Event.OPEN, openHandler);
      my_loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
      my_loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
      my_loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
      my_loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
  
  
  
      try{
          my_loader.load(reqst);
      }catch(error:Error){
          throw new Error(" we have and error " + error, 100);
          debug_.text = "predicted error: " + error;
      }
  
      }
  
      function completeHandler_(event:Event):void{
      var serverResult:String = String(event.target.data);
  
      debug_.text += event.toString();
     }
  
     function openHandler(event:Event):void {
  
      debug_.text +=  "\n" + event.toString();
     }
  
     function progressHandler(event:ProgressEvent):void {
      trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
     }
  
  
     function httpStatusHandler(event:HTTPStatusEvent):void {
      trace("httpStatusHandler: " + event);
  
      debug_.text += "\n" + event.toString();
     }
  
     function securityErrorHandler(event:SecurityErrorEvent):void { 
      trace("securityErrorHandler: " + event);
      throw new Error("securityErrorHandler: " + event, 1);
  
      debug_.text += "\n" + event.toString();
    }
  
  
     function ioErrorHandler(event:IOErrorEvent):void {
      trace("ioErrorHandler: " + event);
      throw new Error("ioErrorHandler: " + event, 2);
  
      debug_.text += "\n" +event.toString();
     }
  
  
      contactServer();
  </code></pre>
  
  <p>I'm really clueless here, any help appreciated.</p>