4 Replies Latest reply on Feb 8, 2010 7:32 AM by amandamartino

    passing data to Flex - flashvars question




      I have an application that requires me to pass data between ColdFusion 8.0.1 and Flex 4. My application takes the username of the currently logged in user (stored as a ColdFusion session variable) and passes it to Flex, which then passes the username into a CFC to retrieve the user's info to populate a Name/Address form. I've been trying to do this via a cfm wrapper file (instead of HTML) and flashvars, but regardless of what username I pass in, I always get the same user's information returned to the interface, almost as if the value is hard-coded somewhere in my Flex project. I am setting the flashvar value as:


      <script type="text/javascript">

                  <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->

                  var swfVersionStr = "10.0.0";

                  <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->

                  var xiSwfUrlStr = "playerProductInstall.swf";

                  var flashvars = {};


                       flashvars.userName = "#session.userName#";




      Inside my mxml init() function, I am setting the local flex variable as:

      private function init():void


           var userName:String = this.parameters.userName;



      I had originally just hard-coded a value for userName when I was just testing the CF call Flex was making. Oddly, though, after I removed the hard-coded value and tried passing in the userName value from my cfm wrapper (quick note: I've tried passing in this value as both a session and a URL variable and have gotten the same results in both cases), the data returned is still the data associated with the previously hard-coded value. It's as if the Flex project itself is caching that value somewhere and keeps referring to it even though it's changed, but I have no idea if that's the case (or if it's even remotely possible, for that matter) or where I might look for it. I'm very new to Flex, so any help would be greatly appreciated. I've been using this article as a guide: http://www.adobe.com/devnet/flex/articles/fcf_deploying_flash.html; any better or other articles on this topic that might point me in the right direction are also appreciated.


      Thanks in advance!