4 Replies Latest reply on Jan 20, 2010 1:35 PM by :::@:::

    Problem with calling a Javascript function from flash

    Sprogleg

      I'm trying to call a javascript function from within my swf and I'm having a couple of problems which are confussing me somewhat.

       

      I'm using this to call the function from flash:

      ExternalInterface.call("pgcover");
      

       

      I know that this is calling the function as I have set it trigger an alert action and this comes up properly.

       

      But I don't want the function to trigger an alert, this is just for testing purposes.

      I instead want it to change the styling on a div.

       

      I have set up a test page where I have asigned the function to a button and this works, the div display changes from block to none.

       

      When I get the swf to call the function setup to do the same thing, nothing happens.

       

      function pgcover() 
      { 
        document.getElementById("unlayout").style.display= "none";
      }
      

       

      My swf is embedded in the html page that the javascript is on, I have checked all code and have rulled out spelling mistakes etc.

       

      Any help with this would be amazing as it is driving me crazy.