JavaScript calls the method displayed by Flash through code

  • 2020-12-13 18:49:59
  • OfStack

This article is an example of how JavaScript calls Flash's display methods through code. To share for your reference, the details are as follows:


<script type="text/javascript" language="javascript" src="Scripts/swfobject.js"></script>
<script language="javascript">
  function load(){
    var swfVersionStr = "10.0.0";
    var params = {};
    params.quality = "high";
    params.allowfullscreen = "false";
    params.allowscriptaccess = "always";
    //params.wmode = "transparent";
    swfobject.embedSWF("flash/MainPage.swf", "FlashID", "597", "416", swfVersionStr,params);
  }
  // call flash The method in, "swfId" for html In the page swf the id
  function setValue(o) {
    thisMovie("FlashID").getIds(o);
  }
  // Set up js with flash Interworking environment 
  function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
     return window[movieName];
    } else {
     return document[movieName];
    }
  }
</script>

For more information about JavaScript, please refer to JavaScript Animation Special Effects and Techniques summary, javascript Object-oriented Tutorial and JavaScript Data Structure and Algorithm Techniques Summary.

I hope this article has been helpful in JavaScript programming.


Related articles: