0

Dreamweaver で作成されたいくつかの swf ムービーを含む Web ページがあり、次のようないくつかのオブジェクト タグを出力します。

<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>

私は次のことをしたいと思います:

  1. Swf アニメーションは、ページの読み込み時に 1 回実行されます (これは現在発生しています)。
  2. ユーザーが [Replay Movie] ボタンをクリックすると、関連付けられている swf がムービーが終了するまで再生されます。

javascript または jQuery を使用して、オブジェクト タグの内容をリロードするか、swf を再生して成功しないコードを見つけようとしています。jqueryボタンのクリックでswfムービーを再生するにはどうすればよいですか?

4

1 に答える 1

0

デモ: http://jsfiddle.net/tive/Ff7Mq/

デモ 2: http://jsfiddle.net/tive/J6WQm/

イベントをキャプチャし、ファイルのソースを変更します。または、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");
    });
};
于 2013-05-01T19:12:00.003 に答える