HTML 控制播放SWF格式

来源:互联网 发布:淘宝 日本 转运 编辑:程序博客网 时间:2024/05/17 15:04

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>微蓝</title>

</head>

<script type="text/javascript">

<!--  

            function startMovie() {  

                var oFlashMovie = document.getElementById("index");  

                oFlashMovie.Play();  

            }  

 

            function stopMovie() {  

                var oFlashMovie = document.getElementById("index");  

                oFlashMovie.StopPlay();  

            }  

 

            function rewindMovie() {  

                var oFlashMovie = document.getElementById("index");  

                oFlashMovie.Rewind();  

            }  

 

            function displayFrameCount() {  

                var oFlashMovie = document.getElementById("index");  

 

                if (typeof oFlashMovie == "function") {  

                    alert("There are " + oFlashMovie.TotalFrames() + " frames in the movie.");  

                } else {  

                    alert("There are " + oFlashMovie.TotalFrames + " frames in the movie.");  

                }  

            }  

 

            function displayIsMoviePlaying() {  

                var oFlashMovie = document.getElementById("index");  

 

                if (oFlashMovie.IsPlaying()) {  

                    alert("The movie is playing.");  

                } else {  

                    alert("The movie is stopped.");  

                }  

            }  

 

 

//-->

</script> 

<body>

<center>

  <table width="731" height="704" bgcolor="#CCCCCC">

    <tr>

      <td width="721" height="451" align="center" valign="middle"><p></p>

        <table width="100%" height="44" bgcolor="#CCCCCC">

          <tr>

            <td width="100%" height="38" align="center"><span class="STYLE15">海南省万宁市大茂镇赖氏木材拼板厂</span></td>

          </tr>

        </table>

 

<object type="application/x-shockwave-flash" data="index.swf" width="400" height="400" id="index">  

          <param name="movie" value="index.swf"/>  

          <param name="quality" value="high" /><!--将flash的清晰度设为高-->  

          <param name="menu" value="false" /><!--将flash的右键菜单隐藏-->  

          <param name="wmode" value="transparent" /><!--设置flash背景透明-->  

       </object>  

        <p>  

        <input type="button" value="Play" onclick="startMovie()" />  <br/>

        <input type="button" value="Stop" onclick="stopMovie()" />   <br/>

        <input type="button" value="Rewind" onclick="rewindMovie()" />   <br/>

        <input type="button" value="How Many Frames?" onclick="displayFrameCount()" />  <br/> 

        <input type="button" value="Is Movie Playing?" onclick="displayIsMoviePlaying()" />  

</td>

    </tr>

      </table></td>

    </tr>

  </table>

</center>

</body>

</html>