Home >Web Front-end >JS Tutorial >JavaScript calls Flash display method through code_javascript skills

JavaScript calls Flash display method through code_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 15:16:321438browse

The example in this article describes how JavaScript calls Flash display through code. Share it with everyone 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);
  }
  //调用flash中的方法,"swfId"为html页中swf的id
  function setValue(o) {
    thisMovie("FlashID").getIds(o);
  }
  //搭建js与flash互通的环境
  function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
     return window[movieName];
    } else {
     return document[movieName];
    }
  }
</script>

Readers who are interested in more JavaScript-related content can check out the special topics on this site: "Summary of JavaScript animation special effects and techniques", "Javascript object-oriented introductory tutorial" and "Summary of JavaScript data structure and algorithm skills

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn