0 Replies Latest reply on Jul 25, 2007 8:31 AM by DanitoV

    ERROR on navigateToURL

    DanitoV
      Hi,

      I have a problem passing arguments to Html Local Page. My mxml code:

      <?xml version="1.0"?>
      <!-- wrapper/WrapperCaller.mxml -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" width="522" height="188">
      <mx:Script>
      import flash.net.*;

      private function navURL(event:Event, url:String):void{
      lb1.text = url;

      var uRequest:URLRequest = new URLRequest(url);
      var uVariables:URLVariables = new URLVariables();

      uRequest.method = "GET";
      uVariables.impresora = "LPT1";
      uVariables.texto = ti2.text;
      uRequest.data = uVariables;

      navigateToURL(uRequest, "_parent");
      }
      </mx:Script>
      <mx:Panel width="404" height="132" layout="absolute" title="Test">
      <mx:Label id="lb1" x="10" y="11" width="354"/>
      <mx:TextInput id="ti2" text="Print this Text..." x="10" y="44" width="245"/>
      <mx:Button label="Send to Page" click="navURL(event, 'test.html')" x="263" y="44"/>
      </mx:Panel>
      </mx:Application>

      The HTML code es:

      <html><head>
      <script type="text/javascript">

      function readParms() {
      if (location.search != '') {
      Args = location.search.substring(1);
      alert(Args);

      document.getElementById('cText').value = Args;
      }
      }
      </script>
      </head>

      <body onLoad="readParms();">
      <h1>Param</h1>
      <table width='100%' height='100%' cellspacing='0' cellpadding='0'>
      <tr>
      <td valign='top'>
      <input type="text" name="cText" id="cText" width="300">
      </td>
      </tr>
      </table>
      </body></html>

      Note:
      - All files on Local PC.
      - location.search is empty on IE and not empty on Firefox

      Regards,
      DanitoV