Function insertflash (ELM, URL, W, h ){
If (! Document. getelementbyid (ELM) return;
VaR STR = '';
STR + = '<object width = "' + W + '" Height = "' + H + '" classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">;
STR + = '<Param name = "movie" value = "' + URL + '"> ';
STR + = '<Param name = "wmode" value ="Transparent"> ';
STR + = '<Param name = "quality" value = "autohigh"> ';
STR + = '<embed width = "' + W + '" Height = "' + H + '" src = "' + URL + '" Quality = "autohigh" wmode ="Transparent"Type =" application/X-Shockwave-flash "plugspace =" http://www.macromedia.com/shockwave/download/index.cgi? P1_prod_version = shockwaveflash "> </embed>;
STR + = '</Object> ';
Document. getelementbyid (ELM). innerhtml = STR;
}
AboveCodeAfter writing JavaScript code, you can call it on the page where you want to display flash:
<Div id = "testflash"> </div>
<SCRIPT type = "text/JavaScript">
Insertflash ('testflash', 'swf/test.swf ', 202,74 );
</SCRIPT>
In this case, 202 is the width and 74 is the height.
Pay attention to the bold red "in the JS CodeTransparent"Is transparent to flash in IE;
And green bold"Transparent"Flash is transparent in ff.