navigateToURL with GET parameters in local SWF

Posted by Michael Brewer-Davis on Stack Overflow See other posts from Stack Overflow or by Michael Brewer-Davis
Published on 2010-04-22T19:41:32Z Indexed on 2010/04/22 19:43 UTC
Read the original article Hit count: 325

Filed under:
|
|
|

I'm running a Flex application locally (local-with-filesystem or local-trusted), and I'm trying to call navigateToURL to a local page using GET parameters. Flash Player seems to be ignoring the parameters when opening the local page, though.

I've been scouring the Flash security pages to find a documented prohibition for this, but haven't found anything. Pointers?

How would you work around this issue?

My Flex app:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
    <![CDATA[
        private function onClick(event:MouseEvent):void {
            var request:URLRequest = new URLRequest("target.html");
            request.data = new URLVariables();
            request.data.text = "stackoverflow.com";
            navigateToURL(request);
        }
    ]]>
</mx:Script>
    <mx:Button label="Go" click="onClick(event)" />
</mx:Application>

And my target.html:

<html>
  <head>
    <script language="JavaScript">
    <!--
      function showURL() {
     alert(window.location.href);
      }
    //-->
    </script>    
  </head>
  <body onload="showURL()" />
</html>

© Stack Overflow or respective owner

Related posts about flex

Related posts about flash