在網(wǎng)頁(yè)里用一個(gè)DIV和一個(gè)JS的計(jì)時(shí)時(shí)間來(lái)達(dá)到動(dòng)態(tài)控制flash舞臺(tái)的效果。另外,可在flash里加入actionscript來(lái)配合:
_root._xscale=int(300);
_root._yscale=int(300);
網(wǎng)頁(yè)里的代碼:
<html>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<div id="Layer1" style="position:absolute; left:600px; top:15px; width:200px; height:200px; z-index:0; overflow: visible;">
<object id="tt1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="200" height="200">
<param name="movie" value="test.swf">
<param name="quality" value="high">
<embed src="test.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="200" height="200" ></embed>
</object>
</div>
<p>
<INPUT onclick="setSize()" type="button" value="setSize">
<SCRIPT LANGUAGE="JavaScript">
<!--
function setSize()
{
document.getElementById("tt1").width=600;
document.getElementById("tt1").height=600;
document.getElementById("Layer1").style.left=100;
document.getElementById("Layer1").style.top=15;
document.getElementById("Layer1").width=600;
document.getElementById("Layer1").height=600;
}
function setSize2()
{
document.getElementById("tt1").width=200;
document.getElementById("tt1").height=200;
document.getElementById("Layer1").style.left=600;
document.getElementById("Layer1").style.top=15;
document.getElementById("Layer1").width=200;
document.getElementById("Layer1").height=200;
}
//-->
function timedMsg()
{
var t=setTimeout("setSize()",5000)
var t2=setTimeout("setSize2()",10000)
}
</SCRIPT>
</p>
<body onLoad="timedMsg()">
<table width="951" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="698" height="71" bgcolor="#00FF66"> </td>
<td width="253"> </td>
</tr>
</table>
<p> </p>
</body>
</html>
posted on 2007-12-13 17:22
lzj520 閱讀(1249)
評(píng)論(0) 編輯 收藏 所屬分類(lèi):
個(gè)人學(xué)習(xí)日記 、
Ria