3 Replies Latest reply on Apr 13, 2007 12:17 PM by dennismr

    URLRequest data

      I have this code to get data from a remote asp page. I'm able to see the full url encoded return string but I can't get the individual variable from the string by specifyinv variables.txtName. Can anyone see what I'm doing wrong? Here's the code:

      public function Agree():void{
      var request:URLRequest = new URLRequest();
      request.contentType = "text/xml"
      request.url = " http://webdev.myview.swst.com/navigator/flextest.asp";
      request.method = URLRequestMethod.POST;
      var loader:URLLoader = new URLLoader();
      loader.dataFormat = URLLoaderDataFormat.VARIABLES;
      loader.addEventListener(Event.COMPLETE, completeHandler);
      public function completeHandler(event:Event):void{
      var loader2:URLLoader = URLLoader(event.target)
      var variables:URLVariables = new URLVariables(loader2.data)
      decl.label = variables.txtName;

      Here's the string that I get:

      %3C%21DOCTYPE%20HTML%20PUBLIC%20%22%2D%2F%2FW3C%2F%2FDTD%20HTML%204%2E0%20Transitional%2F% 2FEN%22%3E%0D%0A%0D%0A%3Chtml%3E%0D%0A%3Chead%3E%0D%0A%09%3Ctitle%3EUntitled%3C%2Ftitle%3E %0D%0A%3C%2Fhead%3E%0D%0A%0D%0A%3Cbody%3E%0D%0AtxtName=Server%2EUrlEncode%28%27mike%27%29% 0D%0A%0D%0A%0D%0A%3C%2Fbody%3E%0D%0A%3C%2Fhtml%3E%0D%0A