2 Replies Latest reply on Dec 19, 2007 7:00 AM by JKohn99

    Passing parameters from HTML to Flex app

      It sounds so easy. :) I am able to "hard code" variables into the wrapper, thanks to this article:


      Everything he suggests works, but the problem is, that example forces you to manually edit the HTML. What if you need to dynamically assign a value? For instance:


      Or something of that nature. How do I get it to pass the name through the wrapper, and into my flex app? I've been digging around on Adobe's site, all I could find is examples on how to get the data from "Application.application.parameters".

      Thanks for any help, I'm getting nothing from Google. All blogs seem to point to Yakov Fain's article. :)

        • 1. Re: Passing parameters from HTML to Flex app
          JKohn99 Level 1
          You need to use some JavaScript to get variables passed in from the url.

          An example is:
          function getQueryVariable(variable)

          var query = window.location.search.substring(1);
          var vars = query.split("&");
          for (var i=0;i<vars.length;i++)
          var pair = vars .split("=");
          if (pair[0] == variable)
          return pair[1];

          Then use the exernalInterface to call this method from you flex application.

          This example gets a variable called fromPortal

          var fromP:String = ExternalInterface.call("getQueryVariable","fromPortal");
          • 2. Re: Passing parameters from HTML to Flex app
            JKohn99 Level 1
            Also, To include this javascript in all of you flex projects put it in then html template.