<OBJECT id="flash1" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0 WIDTH=468 HEIGHT=95> <PARAM NAME=movie VALUE=http://ad4.sina.com.cn/zhlx/sx359-718-hptl.swf> <PARAM NAME=quality VALUE=high> <EMBED src=http://ad4.sina.com.cn/zhlx/sx359-718-hptl.swf quality=high WIDTH=468 HEIGHT=95 TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT><input type=button id=btn1 value="变小" onclick="changeSize(1)">
<input type=button id=btn2 value="变大" onclick="changeSize(2)">
<input type=button id=btn3 value="改变flash" onclick="changeFlash(1)">
<input type=button id=btn4 value="改变flash" onclick="changeFlash(2)"><script>
function changeSize(id)
{
if(id==1)
{
  document.all("flash1").width=200;
  document.all("flash1").height=100;
}
else
{
  document.all("flash1").width=400;
  document.all("flash1").height=200;
}
}function changeFlash(id)
{
if(id==1)
  document.all("flash1").movie = "http://ad4.sina.com.cn/shc/jiahuahomeleft041.swf";
else
  document.all("flash1").movie = "http://ad4.sina.com.cn/zhlx/sx359-718-hptl.swf";
}
</script>

解决方案 »

  1.   

    啊?要用javascript呀?可我要动态添加怎么办?不能用C#代码实现吗?
      

  2.   

    可以在服务端生成javascript来控制它Response.Write("<script defer>document.all('flash1').width=200;</script>");
      

  3.   

    关键是如何创建这个控件,如果要用Render重写Html代码那可实在是太麻烦了,我在一个装配件中用的全部是WebControl控件中默认的呈现,难道就没有一种办法在C#代码中实现(不用javascript语言)?