1 Reply Latest reply on Dec 10, 2007 1:45 AM by Sreenivas R

    Oddness or beginner question

    BrianEagan
      Hi,
      As noted, I'm a flex/AS beginner, apologies if this is the nature of my problem.

      I'm trying to load the parameters via: Application.application.parameters

      in flex builder 3 M3 Beta2, I get no compile errors, and if I use the autoimport feature, I get a proper:
      import mx.core.Application;

      Now, when I try to use Application.application.parameters in any way, my application does not load. Debugging yields that it's set to null.

      My understanding is that Application.application is a reference to the top Application, which should have access to the parameters.

      Am I missing something? I suspect that's the case.

      Thanks for any clues or help,
      Brian
        • 1. Oddness or beginner question
          Sreenivas R Adobe Employee
          Assuming you have not turned of the html template option in the Flex project options, you need to edit the html template.html file to provide any parameters as FB uses this file to load the SWF. The file is located in the html-template directory of the project.

          Open the html file and add a entry like FlashVars shown below in the AC_FL_RunContent call inside the hasRequestedVersion if block.

          I have shown testMe=where as the value you can put all the parameters here.

          else if (hasRequestedVersion) {
          // if we've detected an acceptable version
          // embed the Flash Content SWF when all tests are passed
          AC_FL_RunContent(
          "src", "${swf}",
          "FlashVars", "testMe=where",
          "width", "${width}",
          "height", "${height}",
          "align", "middle",
          "id", "${application}",
          "quality", "high",
          "bgcolor", "${bgcolor}",
          "name", "${application}",
          "allowScriptAccess","sameDomain",
          "type", "application/x-shockwave-flash",
          "pluginspage", " http://www.adobe.com/go/getflashplayer"
          );

          To access the parameters passed on the browser url itself you need to parse the url and take the proper substring and assign it to FlashVars.