2010-01-12 97 views

回答

7

非官方行業標準是使用SWFObject

<script type="text/javascript"> 
    swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0"); 
</script> 

Documentation

+0

如果使用.NET和把一個瑞士法郎成master.page,使用: <腳本類型= 「文本/ JavaScript的」> swfobject.embedSWF(「<%=此。 ResolveUrl(「〜/ live.swf」)%>「,」headerFlash「,」924「,」200「,」9.0.0「); – aron 2010-06-05 18:39:50

3

使用SWFObject爲apphacker mentiond。以防萬一你無法使用它(以支持禁用JS的瀏覽器),下面是如何使用HTML來完成它。

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
     id="myMovie" width="300" height="200" 
     codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> 
    <param name="movie" value="Movie.swf"/> 
    <param name="quality" value="high" /> 
    <param name="bgcolor" value="#ffffff" /> 
    <param name="allowScriptAccess" value="sameDomain" /> 
    <embed src="Movie.swf" quality="high" bgcolor="#ffffff" 
     width="300" height="200" name="myMovie" align="middle" 
     play="true" 
     loop="false" 
     quality="high" 
     allowScriptAccess="sameDomain" 
     type="application/x-shockwave-flash" 
     pluginspage="http://www.adobe.com/go/getflashplayer"> 
    </embed> 
</object> 
0
<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 

WIDTH="850" 

HEIGHT="610" 

CODEBASE="http://active.macromedia.com/flash5/cabs/swflash.cab#version=5,0,0,0"> 

<PARAM NAME="MOVIE" VALUE="2bigpinkballs2.swf"> 

<PARAM NAME="PLAY" VALUE="true"> 

<PARAM NAME="LOOP" VALUE="true"> 

<PARAM NAME="QUALITY" VALUE="high"> 

<PARAM NAME="SCALE" value="noborder"> 

<EMBED SRC="2bigpinkballs2.swf" WIDTH="850" HEIGHT="610" PLAY="true" LOOP="true"    QUALITY="high" 

scale="noborder" 

PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED></OBJECT>