071213 JS计时事件动态控制flash舞台大小变化

在网页里用一个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; οnresize=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   οnclick="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">&nbsp;</td>
    <td width="253">&nbsp;</td>
  </tr>
</table>
<p>&nbsp; </p>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值