10 6 月 2013

js加载flash文件方法

/**
* 实现引入js调用flash文件的函数
* file : 文件具体路径
* w : 宽
* h : 高
*/
function loadFlash(file, w, h){
     document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+w+'" height="'+h+'">');
     document.write('<param name="movie" value="'+file+'" />');
     document.write('<param name="quality" value="high" />');
     document.write('<embed src="'+file+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed>');
     document.write('</object>');
}
1
<script type="text/javascript"language="javascript">getFlash('hehe.swf','500','220');</script>

 

原文地址:http://devphp.blog.163.com/blog/static/199763017201052942718506/