方法一: document.write('<a href="http://www.123456789.com/" target="_blank"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="宽度" height="高度"><param name="movie" value="FLASH文件地址"><param name="quality" value="high"><embed src="Flash文件地址" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="宽度" height="高度"></embed></object></a>');
写好后以.js格式保存起来。然后在网页中插入调用JS文件的代码就OK了。 html中调用JS文件的写法: <script language="JavaScript" type="text/javascript" src="刚刚保存的JS文件地址"></script>
方法二: function swf(file,w,h) { document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwa ve/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('<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" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed> '); document.write('</object> ');
页面调用: <script type="text/javascript" language="javascript">swf(hehe.swf','500','220');</script>
flash背景变透明代码: <param name="wmode" value="transparent"> |