如何使用Javascript暂停/恢复音频.swf?

时间:2013-09-23 14:19:09

标签: javascript jquery

我用Flash创建了一个包含一首mp3歌曲的音频swf文件;没有其他的。因此,没有ActionScript。我已经将它嵌入到Dreamweaver的html文件中,我有以下代码:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="20" height="20"   
id="FlashID"     title="test">
<param name="movie" value="struggle.swf">
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="6.0.65.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="struggle.swf" width="20" height="20">
<!--<![endif]-->
<param name="quality" value="high">
<param name="wmode" value="opaque">
<param name="swfversion" value="6.0.65.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>

到目前为止,这么好。每次我的页面加载时都会播放这首歌。现在,我希望在我的html文件中有一个按钮来控制swf。按一下暂停歌曲,再次按下恢复。我尝试了很多方法,但是没有一种方法可行。例如:

window.document.flashID.Play();

不起作用...
此外,jQuery SWFObject插件不起作用(也许它只适用于电影?)。其他一些尝试没有成功。请任何想法,我对此感到厌倦。

0 个答案:

没有答案
相关问题