<html>
<head>
<title>Flash Resize</title>
<SCRIPT LANGUAGE="JavaScript">
<!--
function newSize(datoX,datoY) {
if(document.all && !document.getElementById) {
document.all[’miFlash’].style.pixelWidth = datoX;
document.all[’miFlash’].style.pixelHeight = datoY;
}else{
document.getElementById(’miFlash’).style.width = datoX;
document.getElementById(’miFlash’).style.height = datoY;
}
}
//-->
</script>
<style type="text/css">
<!--
td {
font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" leftmargin="0" rightmargin="0" onLoad="javascript :newSize(1,1);">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr bgcolor="#eeeeee">
<td>This is HTML</td>
</tr>
<tr>
<td> <div id="miFlash" style="position:relative; width:1px; height:1px; z-index:1">
<table height="100%" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=7,0,0,0" width="100%" height="100%"
id="flashResize" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flashResize.swf" />
<param name="loop" value="false" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="salign" value="lt" />
<param name="bgcolor" value="#ffffff" />
<embed src="flashResize.swf" loop="false" menu="false" quality="high"
scale="noscale" salign="lt" bgcolor="#ffffff" width="100%"
height="100%" name="flashResize" align="middle"
allowScriptAccess="sameDomain" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object> </td>
</tr>
</table>
</div> </td>
</tr>
<tr bgcolor="#eeeeee">
<td>This is HTML</td>
</tr>
</table>
</body></html>
Flash大小是100%,固定比例和靠左上角,Layer的大小默认是1pix*1pix,
因此Flash一开始要调用newSize();将Layer大小改为目前的Flash大小,
否则就看不到flash。
//----------------------------