5 Replies Latest reply on Jan 29, 2010 12:10 PM by kglad

    flash javascript problems

    mark bower

      I am attempting to get Flash - Javascript communication working using ExternalInterface.addCallback, using code found at http://kb2.adobe.com/cps/156/tn_15683.html. I am trying to pass parameters into Flash using a javascript function, but it only works if I insert a 'window.alert' line into the code. Once I click OK, the parameter str is passed into Flash ok. The function is:

       

                     function sendToFlash(str) {
             
              if (str=="tools"){
                  window.alert(str);   
              getFlashMovie("richFunctionality_corp").sendTextToFlash(str);
             
              }
             
              if (str=="components"){
                  window.alert(str);
              getFlashMovie("richFunctionality_corp").sendTextToFlash(str);
                      
              }
             
             
             
              }

       

      If I remove the window.alert, str isn't passed into Flash. Is this a browser speed thing?

       

      A value menu is passed out of Flash using getURL("index.php?pageID=239&menu=tools"), i.e. the page reloads and a php script  sends the appropriate str value to the sendToFlash javascript function based upon the value of menu.

       

       

      Help! I'm totally at a loss here and my javascript knowledge is very basic.

       

      Thanks...