在网页里用一个DIV和一个JS的计时时间来达到动态控制flash舞台的效果。另外,可在flash里加入actionscript来配合:
_root._xscale=int(300);
_root._yscale=int(300);
网页里的代码:
<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 阅读(1246)
评论(0) 编辑 收藏 所属分类:
个人学习日记 、
Ria