Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在jquery按钮单击上重播swf电影?_Javascript_Jquery_Flash - Fatal编程技术网

Javascript 如何在jquery按钮单击上重播swf电影?

Javascript 如何在jquery按钮单击上重播swf电影?,javascript,jquery,flash,Javascript,Jquery,Flash,我有一个包含几个swf电影的网页,这些电影是在dreamweaver中创建的,并输出几个对象标记,如: <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="160" height="600"> <param name="movie" value="Banners Template/Example_160x600.swf" /> <param

我有一个包含几个swf电影的网页,这些电影是在dreamweaver中创建的,并输出几个对象标记,如:

<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="160" height="600">
    <param name="movie" value="Banners Template/Example_160x600.swf" />
    <param name="quality" value="high" />
    <param name="wmode" value="opaque" />
    <param name="swfversion" value="9.0.45.0" />
    <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
    <param name="expressinstall" value="Scripts/expressInstall.swf" />
    <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. --> 
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="Banners Template/Example_160x600.swf" width="160" height="600">
      <!--<![endif]-->
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="9.0.45.0" />
      <param name="expressinstall" value="Scripts/expressInstall.swf" />
      <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
      <div>
        <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
        <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
      </div>
      <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
  </object>
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>

此页面上的内容需要更新版本的Adobe Flash Player。

swfobject.registerObject(“FlashID”);
我想做以下工作:

  • Swf动画在页面加载时运行一次(这是 (目前正在发生)
  • 一旦用户单击“回放电影”按钮, 与之关联的swf将重播,直到电影结束
  • 我一直在尝试寻找一些代码,这些代码可以利用javascript或jQuery来重新加载对象标记的内容或重放swf,但没有成功。我如何在jquery按钮上重播swf电影?单击?

    演示:

    演示2:

    捕获事件并更改文件的源。 或者使用swf对象再次渲染div

    var initVideos = function () {
        var divs = $("ul li a");
    
        // bind your click event to the divs
        divs.click(function (e) {
            e.preventDefault(); // use this when you're triggering anchor tags
            flashembed("videoArea", $(this).prop("href"));
            divs.removeClass("active");
            $(this).addClass("active");
        });
    };
    

    虽然这些都是很酷的例子,但它们并没有真正解决我在使用dreamweaver输出的臃肿对象标记时遇到的问题。主要问题是其他(非开发)人员将在dreamweaver中插入swf。我们需要能够添加jquery代码,使电影能够重播。