function InsertFlash(Flash,Width,Height,ID){
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");
document.write("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" ");
document.write("width=\"" + Width + "\" height=\"" + Height + "\" id=\"" + ID + "\">");
document.write("<param name=\"movie\" value=\"" + Flash + "\">");
document.write("<param name=\"quality\" value=\"high\">");
document.write("<param name=\"wmode\" value=\"transparent\">");
document.write("<embed src=\"" + Flash + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ");
document.write("type=\"application/x-shockwave-flash\" width=\"" + Width + "\" height=\"" + Height + "\"></embed>");
document.write("</object>");
}
======================================
页面中写入的代码为:
先调用本js程序
<script type="text/javascript" src="flash.js"></script>
//需要放置flash的地方插入(需要注意,insertflash最后一个属性是ID,在同一个页面中必须是唯一的,在本解决方案中他是无关紧要的,建议保留。):
<script type="text/javascript">
InsertFlash("images/top.swf",500,150,"top");
</script>