2008-10-06 54 views
1

我有一個帶有Flash內容的生成HTML頁面。我正在嘗試重新定位Flash內容並將其設置爲「絕對」。我試圖用div標籤包裝對象標籤,但無濟於事。誰能告訴我如何做到這一點?刪除生成的定位屬性不起作用。使用CSS定位Flash內容

請參見下面的相關代碼(不是很整齊,但是這是它是如何生成的我已刪除了最不相關的代碼):

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>* welcome *</title> 
<script language="javascript">AC_FL_RunContent = 0;</script> 
<script src="AC_RunActiveContent.js" language="javascript"></script> 
</head> 
<body bgcolor="#000000"> 
<script language="javascript"> 
if (AC_FL_RunContent == 0) { 
    alert("This page requires AC_RunActiveContent.js."); 
} else { 
    AC_FL_RunContent(
     'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 
     'width', '430', 
     'height', '200', 
     'src', 'bar', 
     'quality', 'high', 
     'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 
     'align', 'right', 
     'play', 'true', 
     'loop', 'true', 
     'scale', 'showall', 
     'wmode', 'transparent', 
     'devicefont', 'false', 
     'id', 'bar', 
     'bgcolor', '#000000', 
     'name', 'bar', 
     'menu', 'true', 
     'allowFullScreen', 'false', 
     'allowScriptAccess','sameDomain', 
     'movie', 'bar', 
     'salign', '' 
     ); //end AC code 
} 
</script> 
<noscript> 
<div style = "position: absolute"> 
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="430" height="200" id="bar" align="right"> 
    <param name="allowScriptAccess" value="sameDomain" /> 
    <param name="allowFullScreen" value="false" /> 
    <param name="movie" value="bar.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" /> 
    </object> 
</div> 
</noscript> 

提前感謝!

回答

3

你應該把實際上創建你的對象的JS腳本放在你的div之前。

+0

*臉掌*當然!謝謝! – pypmannetjies 2008-10-06 16:41:28

3

既然你的div被封裝在noscript中,它只會在javascript被關閉時顯示,你確定這是你想要的行爲嗎?

+0

嘿謝謝。至少我現在知道什麼是無腳本標籤了! ;) – pypmannetjies 2008-10-07 14:51:18

1

@ Fuzzy76 & @ epeleg.blogspot.com是正確

@pypmanetjies - >您的代碼必須是這樣的(縮短):

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
    <title>* welcome *</title> 
    <script language="javascript">AC_FL_RunContent = 0;</script> 
    <script src="AC_RunActiveContent.js" language="javascript"></script> 
    </head> 
    <body bgcolor="#000000"> 
<div style = "position: absolute"> 
    <script language="javascript"> 
    if (AC_FL_RunContent == 0) { 
      alert("This page requires AC_RunActiveContent.js."); 
    } else { 
      AC_FL_RunContent(
... 
); //end AC code 
    } 
    </script> 
    <noscript> 
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="430" height="200" id="bar" align="right"> 
     <param name="allowScriptAccess" value="sameDomain" /> 
     <param name="allowFullScreen" value="false" /> 
     <param name="movie" value="bar.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#000000" /> 
     </object> 

    </noscript> 
</div> 
1

您可能需要設定的寬度和高度你也是。