JS函数控制网页中Flash动画的播放
函数名 使用 作用
play() wgzc.play() 播放Flash动画
stopplay() wgzc.stopplay() 停止播放Flash动画
rewind() wgzc.rewind() 停止播放Flash动画并返回第一帧
totalframes() wgzc.totalframes() 返回Flash动画总帧数
gotoframe(int num) wgzc.gotoframe(int num) 转到指定帧
二、程序代码:
<html>
<head>
<script language="javascript">
function init()
{ document.changeframe.totalfrm.value=document.wgzc.totalframes }
</script>
</head>
<body onload="init()" bgcolor="#FFFFFF" bgproperties="fixed">
<fieldset>
<legend><font color="#FF0000">控制Flash动画</font></legend>
<form name="changeframe">
<font color="#800000">
Flash动画帧数:</font><font color="#000080"><b><input name="totalfrm" type="text" size=4 value="1" disabled>
</b></font><font color="#800000">
输入第</font><b><font color="#000080"><input name="framenum" type="text" size=4 value="1"></font></b><font color="#800000">帧,再点击"指定帧"。</font>
</form>
<a href="#" onclick="javascript:document.wgzc.play()"><font color="#800080">播放</font></a>
<b><font color="#000080">
</font></b>
<a href="#" onclick="javascript:document.wgzc.stopplay()"><font color="#800080">停止</font></a>
<font color="#000080">
<b> </b></font>
<a href="#" onclick="javascript:document.wgzc.rewind()"><font color="#800080">停止返回第一帧</font></a>
<b><font color="#000080">
</font></b>
<a href="#" onclick="javascript:document.wgzc.gotoframe(document.changeframe.framenum.value)"><font color="#800080">指定帧</font></a><center>
</fieldset>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="#version=4,0,0,0"
ID=wgzc WIDTH=500 HEIGHT=100>
<PARAM NAME=movie VALUE="">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="" quality=high bgcolor=#FFFFFF
WIDTH=500 HEIGHT=100 TYPE="application/x-shockwave-flash"
PLUGINSPAGE="?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</center>
</body>
</html>