flash动画|js|函数|控制|网页
一、介绍与Flash动画控制有关的javascript函数:
函数名 使用 作用
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 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="#" ><font color="#800080">播放</font></a>
<b><font color="#000080">
</font></b>
<a href="#" ><font color="#800080">停止</font></a>
<font color="#000080">
<b> </b></font>
<a href="#" ><font color="#800080">停止返回第一帧</font></a>
<b><font color="#000080">
</font></b>
<a href="#" ><font color="#800080">指定帧</font></a><center>
</fieldset>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
ID=wgzc WIDTH=500 HEIGHT=100>
<PARAM NAME=movie VALUE="/UploadPic/2007-7/200777143632155.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="http://file.wbgxw.com/UpLoadPic/2007-7/200777143632155.swf" quality=high bgcolor=#FFFFFF
WIDTH=500 HEIGHT=100 TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</EMBED>
</OBJECT>
</center>
</body>
</html>