写好的Flash函数,直接嵌入flash的接口

jackxiang 2010-5-14 15:07 | |
使用方法:
        
<script language="JavaScript" type="text/javascript">
swf_load('index','index.swf','1024','650','','opaque');
</script>


embededflash.html:
function swf_load(fileid, filename, widths, heights, fvs, wmd)
{
    this.FlashVars = (fvs != undefined)? fvs :'';
    this.Wmod = (wmd != undefined)? wmd :'';

    var strSwf = "";

    strSwf += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
    strSwf += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"';
    strSwf += 'width="'+widths+'" height="'+heights+'" id="'+fileid+'" >';
    strSwf += '<param name="movie" value="'+filename+'" />';
    strSwf += '<param name="quality" value="high" />';
    strSwf += '<param name="menu" value="false" />';
    strSwf += (FlashVars != null) ? '<param name="FlashVars" value="'+FlashVars+'">' : '';
    strSwf += (Wmod != null) ? '<param name="wmode" value="'+Wmod+'">' : '';
    strSwf += '<embed';
    strSwf += (FlashVars != null) ? ' FlashVars="'+FlashVars+'"' : '';
    strSwf += (Wmod != null) ? ' wmode="'+Wmod+'"' : '';
    strSwf += ' src="'+filename+'" quality="high" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer"';
    strSwf += 'type="application/x-shockwave-flash" width="'+widths+'" height="'+heights+'"  name="'+fileid+'" ></embed>';
    strSwf += '</object>';

    document.write(strSwf);
}

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/3071/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!

评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]