4 Replies Latest reply on Dec 11, 2006 3:05 PM by thx1138

    flashVars + HTML Wrapper + Flex 2

    ljonny18 Level 1
      Hi

      Can someone please help me….

      I am trying to use “flashVars” within my Flex 2 application…..

      I am having trouble incorporating them into the wrapper (HTML file) that is created by default when the flex application is built….

      When I try to include the flashVars in the param and embed script:

      <param name="FlashVars" value="…………." />
      ………..
      <embed src="…." quality="high" flashvars="………." name="……." play="true" etc………………..

      depending on the context, I get different javaScript conflicts and errors…

      is there a standard format to follow when creating a wrapper for flashVars using Flex 2???

      Can anyone help me, or post an example etc….?


      Thanks, Jon.
        • 1. Re: flashVars + HTML Wrapper + Flex 2
          ntsiii Level 3
          I haven't worked with this myself, but I uderstand that when using the wrapper generated by Flex Builder, the flashvars are actually set using javascript in one of the .js files, not using the html tags.

          Tracy
          • 2. Re: flashVars + HTML Wrapper + Flex 2
            GeorgeWS Level 1
            I am doing this. I modified the html (wrapper). I added to the "flashvars "in the AC_FL_RunContent section of the wrapper. I am passing variables employee and supcomp. So my flashvars looks like:

            "flashvars", 'historyUrl=history.htm%3F&lconid=' + lc_id + '&Employee=#Employee#' + '&SupComp=#SupComp#'
            I also added these variables to the object and the embed tags.
            • 3. Re: flashVars + HTML Wrapper + Flex 2
              NCAA-KL
              First, I found this link helpful: http://webddj.sys-con.com/read/283888.htm

              All I wanted to do was see if I could pass some variables to flash when it first started up. I found the examples in the flex 2 developer guide entitled using flashVars to not be helpful.

              But I did get it working...
              1. I copied the source from the browser after launching flash from flex developer.
              2. I copied this file to <project-name>/assets directory. Don't do that. It needs to be in the <project-name>/bin directory.
              3. I tried to use the example in the flex docs...don't do that. Instead, do a search on AC_FL_RunContent in your wrapper html.
              change this line:
              "flashvars", "historyUrl=history.htm%3F&lconid=' + lc_id + ' ',
              to something like this:
              "flashvars", "historyUrl=history.htm%3F&lconid=' + lc_id + 'firstname=kevin',

              4. In your main application file, make sure you have the following:
              <mx:Application ... initialize="initApp()"
              ...
              <mx:Script>
              <![CDATA[
              [Bindable]
              private var myName:String;
              private function initApp():void{
              myName = Application.application.parameters.firstname;
              }
              ]]>
              ...
              <mx:Label text="{myName}"/>
              ...
              </Application>

              Hopefully, this gets you up and running. I am by no means a flex expert, and would appreciate feedback if the above isn't the best way to do things.

              -K
              Text
              • 4. Re: flashVars + HTML Wrapper + Flex 2
                thx1138 Level 1
                If you do anything more than add a few variables you might want to check out FXT. It is search engine friendly and separates the data from the view. Here is some information and step by step instructions.

                Information:
                http://www.judahfrangipane.com/blog/?p=37

                Getting started:
                http://www.judahfrangipane.com/blog/?p=44