zoukankan      html  css  js  c++  java
  • Html页面中Flash的播放,并利用JS变换Flash

    advertiser-Flash.js:

    var w = 350;
    var h = 400;

    function swf(file) {
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,0,1,152" width="' + w + '" height="' + h + '"> ');
    document.write('<param name="movie" value="' + file + '">');
    document.write('<param name="quality" value="high"> ');
    document.write('<param name="wmode" value="transparent"> ');
    document.write('<param name="menu" value="false"> ');

    document.write('<embed src="' + file + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" menu="false" wmode="transparent" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '"></embed> ');
    document.write('</object> ');
    }

    function NewComing(file) {
    var htmlStr = null;
    htmlStr = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=11,0,1,152"';
    htmlStr += ' width="' + w + '" height="' + h + '"> ';
    htmlStr += '<param name="movie" value="' + file + '">';
    htmlStr += '<param name="quality" value="high">';
    htmlStr += '<param name="wmode" value="transparent">';
    htmlStr += '<param name="menu" value="false"> ';
    htmlStr += '<embed src="' + file + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" menu="false" wmode="transparent" ';
    htmlStr += 'type="application/x-shockwave-flash" width="' + w + '" height="' + h + '"></embed>';
    htmlStr += '</object>';
    return htmlStr;

    }

    function DefaultPlay(file) {
    swf(file);
    }

    function KeyPlay(file) {
    document.getElementById("content_flash").innerHTML = NewComing(file);
    }

    页面代码(加载页面时,默认开始播放第一个):

    <script type="text/javascript" src="advertiser-flash.js"></script>


    <div style="40%" id="content_flash">
    <script type="text/javascript" language="javascript">DefaultPlay("flash/1.swf");</script>
    </div> 
    <div style="60%">

    <ul class="left_nav1" style="margin-top:10px;">
    <li class="left_nav1_li left_nav1_li_default " onclick="KeyPlay('flash/1.swf');">
    </li>
    <li class="left_nav1_li" onclick="KeyPlay('flash/2.swf');">

    </li>
    <li class="left_nav1_li" onclick="KeyPlay('flash/3.swf');">

    </li>
    <li class="left_nav1_li" onclick="KeyPlay('flash/4.swf');">

    </li>
    <li class="left_nav1_li" onclick="KeyPlay('flash/5.swf');">

    </li>
    </ul>
    </div>

     
    就这样吧。其实关键还是那个JS~~~




    作者:Ivan
    个人网站:http://www.IvanBy.com
  • 相关阅读:
    wp7订餐客户端源码
    AOP技术术语
    urlpattern详解
    .net 访问IBM DB2 数据库
    入驻博客园
    hadoop视频
    阿里OneData构建数据指标体系
    大数据领域全景解析
    PyTorch中梯度为什么默认自动累加,在反向传播前要手动将梯度清零?
    Pytorch:Dataloader和Dataset以及搭建数据部分的步骤
  • 原文地址:https://www.cnblogs.com/oneivan/p/2264979.html
Copyright © 2011-2022 走看看