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
  • 相关阅读:
    springboot系列九,springboot整合邮件服务、整合定时任务调度
    springboot系列八、springboot整合kafka
    springboot系列六、springboot配置错误页面及全局异常
    springboot系列五、springboot常用注解使用说明
    springboot系列四、配置模板引擎、配置热部署
    springboot系列三、springboot 单元测试、配置访问路径、多个配置文件和多环境配置,项目打包发布
    springboot系列二、springboot项目搭建
    springboot系列一、springboot产生背景及介绍
    kafka系列十、kafka常用管理命令
    Jmeter4.X
  • 原文地址:https://www.cnblogs.com/oneivan/p/2264979.html
Copyright © 2011-2022 走看看