js调用flash代码
时间:2010-01-23 12:35:00
JS代码:
function showFlash(src,w,h){
html = '';
html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'" id="main">';
html += '<param name="allowScriptAccess" value="sameDomain" />';
html += '<param name="movie" value="images/'+src+'.swf" />';
html += '<param name="quality" value="high" />';
html += '<param name="menu" value="false" />';
html += '<param name="wmode" value="transparent" />';
html += '<embed src="images/'+src+'.swf" wmode="transparent" menu="false" quality="high" width="'+w+'" height="'+h+'" name="main" align="center" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
html += '</object>';
document.write(html);
}
以上代码保存为showFlash.js文件,在需要调用的页面<script language="javascript" src="images/showFlash.js"></script>
调用方法:
showFlash('文件名(不带扩展名)','宽度','高度')
例:
<script>showFlash('index','940','480')</script>
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
如何设置SQL Server数据库全文索引服务
mysql 主从服务器的简单配置
文字的减法
用Dreamweaver 4.0编制会议通知
![](https://img.aspxhome.com/file/UploadPic/20072/200723113127669s.jpg)
OverFlow – 一个秘密武器
![](https://img.aspxhome.com/file/UploadPic/20109/25/rss1-42s.png)
Web开发技术发展史话
注册和填表中常见的中英文对照
5个有趣的浏览器地址栏Javascript代码
![](https://img.aspxhome.com/file/UploadPic/20087/21/2008721131358635s.gif)
css中浮动思考与小结
firefox通过XUL实现text-overflow:ellipsis的效果
CGArt®2008 贺岁刊电子杂志玉鼠闹春
![](https://img.aspxhome.com/file/UploadPic/20082/15/200821511345421s.jpg)
ORACLE 10g 安装教程[图文]
![](https://img.aspxhome.com/file/UploadPic/20095/26/200952620153777.jpg)
Chrome和firefox使用比较测评
![](https://img.aspxhome.com/file/UploadPic/20103/26/2010326124036780s.gif)
sql中 RecordCount=-1问题
下拉框二级联动的JavaScript代码
四大因素扼杀了中国人的创造力
不得不看的JS基础知识(事件触发篇)
asp用正则过滤html标签
分析SQL语句性能3种方法分享
![](https://img.aspxhome.com/file/UploadPic/20126/6/201266202530418s.png)