使用Swfobject定义swf的宽度

时间:2013-11-07 18:24:26

标签: javascript swfobject

我使用Swfobject在我的网站上嵌入了一个Flash游戏,我定义了维度,但游戏适合容器。我如何定义宽度(和高度)也作为最大宽度?

<!-- Game embedding -->
<script type="text/javascript">
    var attributes = {id: "gm", name: "Rebuild Chile"};
    swfobject.embedSWF("game.swf", "gm", "720", "480", "9.0", null, attributes);
</script>

<div id="gm"></div>
<!-- Game embedding -->

什么是错误的?

1 个答案:

答案 0 :(得分:0)

我这样解决了:

<!-- Game embedding -->
<script type="text/javascript">
    var attributes = {id: "gm", name: "Game name"};
    swfobject.embedSWF("game.swf", "gm", "720", "480", "9.0", null, attributes);
</script>

<div id="gm_container">
  <div id="gm" style="height:480; witdh=:720;">
  </div>  
</div>
<!-- Game embedding -->