SoFunction
Updated on 2025-04-03

JavaScript calls Flash display method through code

This article describes the method of JavaScript calling Flash display through code. Share it for your reference, as follows:

<script type="text/javascript" language="javascript" src="Scripts/"></script>
<script language="javascript">
  function load(){
    var swfVersionStr = "10.0.0";
    var params = {};
     = "high";
     = "false";
     = "always";
    // = "transparent";
    ("flash/", "FlashID", "597", "416", swfVersionStr,params);
  }
  //Call the method in flash, "swfId" is the id of swf in the html page  function setValue(o) {
    thisMovie("FlashID").getIds(o);
  }
  //Build an environment where js and flash communicate with each other  function thisMovie(movieName) {
    if (("Microsoft") != -1) {
     return window[movieName];
    } else {
     return document[movieName];
    }
  }
</script>

For more information about JavaScript, readers who are interested in reading this site's special topic:Summary of JavaScript animation special effects and techniques》、《JavaScript object-oriented tutorial"and"Summary of JavaScript data structure and algorithm techniques

I hope this article will be helpful to everyone's JavaScript programming.