3 Replies Latest reply on Jun 20, 2011 10:34 AM by Flex harUI

    passing parameters from html to flex application

    InfoCon_Brian Level 1

      I am using flex Builder 3. using ActionScript 3

       

      I am trying to pass html parameters via the flashVars outline in

      the help:

      http://livedocs.adobe.com/flex/3/html/help.html?content=passingarguments_3.html

       

      Problem:

      Application.application.parameters equals null

      root is equal to null (I know discontinued in AS3)

      loaderInfo is equal to null.

       

      I am looking at values via the debugger at a break point in

      creationComplete and initialize.

       

      I have modify the html wrapper to for each case outline in the help.

       

      Any ideas as to what I am doing wrong?

       

      code:

       private function init():void
      {
             for (var i:String in Application.application.parameters) {
                ta1.text += i + ":" + Application.application.parameters[i] + "\n";
      }

      Brian
           }
        • 1. Re: passing parameters from html to flex application
          Flex harUI Adobe Employee

          I usually see folks pass in flashvars via a modified html wrapper.  If you

          want folks to pass in params on the URL, use BrowserManager

          • 2. Re: passing parameters from html to flex application
            InfoCon_Brian Level 1

            Well, it not what I want to do, it is a I have to pass parameters via the url

            because of the project design.

             

            I tried the BrowserManager, All I got was null's.

            So, I know I am doing something wrong, but

            I don't know what.

             

            The Design is:

            Given a url with various parameters in the url.

            1) take the url parse the url

            2) organize the data so, that the data can be passed into

                 a flex application.

            3) The flex application will take the data and store

                 the data in an object.

             

            I am trying to get step 2 and 3 to work, but all I am

            getting is null's.  I suspect the problem is in the html wrapper.

            • 3. Re: passing parameters from html to flex application
              Flex harUI Adobe Employee

              Make sure:

               

              1) your project settings include "browser integration"

              2) You followed an example and called BrowserManager.init();

              3) The parameters are passed with a hash (#) not question mark (?)

                  my.site.com/myFlexWrapper.html#param1=foo&param2=bar

                   

              If you can't use hash, I think you have to use your own wrapper and add a

              function that will get the outer URL and use ExternalInterface to call it.