1 Reply Latest reply on Apr 4, 2011 10:34 AM by johnwun

    When I change "FlashVars"(by jquery) I can't grab the new value?

    fell0206

      Hi, everybody, I have some problem below:

      I use FlexGlobals.topLevelApplication.parameters to grab "FlashVars" of parameter, but when I use jquery to change the "FlashVars" of parameter, I still grab the same value, how can I to fix it? Thank you~

      mxml:

      protected function button1_clickHandler(event:MouseEvent):void

      {

           for(var i:String in FlexGlobals.topLevelApplication.parameters){

       

                lbText.text=FlexGlobals.topLevelApplication.parameters.test;

           }

       

      }

       

      test.html:

      <head>

           <script type="text/javascript" src="jquery.js"></script>

           <script type="text/javascript">

                $(document).ready(function(){

                     $("a").click(function(){

                          ($('#audioRecorder param[name=flashvars]').attr('value','465465465'));

                          alert($('#audioRecorder param[name=flashvars]').attr('value'));

                     });

           });

           </script>

      </head>

      <body>

           <a href="#">123</a>

           <object width="323" height="300" type="application/x-shockwave-flash" id="audioRecorder" name="audioRecorder" data="test.swf">

                <param name="movie" value="test.swf"/>

                <param name="flashvars" value="test=123"/>

                </object>

      </body>