SwfObject没有在IE中设置bgcolor

时间:2012-08-15 11:56:40

标签: flash internet-explorer background-color swfobject param

我正在尝试使用SwfObject javascript创建一个flash对象。它如何适用于FF和铬,但它不显示背景颜色


我的JS代码

 var swfWidth = "500";
 var swfHeight = "500";
 var swfBgColor = "#ff0000";

 var flashVersion = '9.0.0'
 var flashvars = false;
 var params = { bgcolor:swfBgColor };
 var attributes = {};

 swfobject.embedSWF(swfUrl, "kcSwf", swfWidth, swfHeight, flashVersion, "/resources/expressInstall.swf", flashvars, attributes, params);

这是我在IE上为上述代码提供的输出。

它会在标记上设置 bgcolor 属性,但它不会在标记中设置bgcolor(见下文)

<OBJECT style="VISIBILITY: visible" id=kcSwf classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=620 height=540 bgcolor="F8F8F8"><PARAM NAME="_cx" VALUE="16404"><PARAM NAME="_cy" VALUE="14287"><PARAM NAME="FlashVars" VALUE="">
 <PARAM NAME="Movie" VALUE="http://test.skf.com/CampaignBanner/knowledgeengineering/090309_banners/flash_example.swf">
 <PARAM NAME="Src" VALUE="http://test.skf.com/CampaignBanner/knowledgeengineering/090309_banners/flash_example.swf">
 <PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1">
 <PARAM NAME="Loop" VALUE="-1">
 <PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE="">
 <PARAM NAME="Menu" VALUE="-1">
 <PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="">
 <PARAM NAME="Scale" VALUE="ShowAll">
 <PARAM NAME="DeviceFont" VALUE="0">
 <PARAM NAME="EmbedMovie" VALUE="0">
 <PARAM NAME="BGColor" VALUE="">           // <--- check this
 <PARAM NAME="SWRemote" VALUE="">
 <PARAM NAME="MovieData" VALUE="">
 <PARAM NAME="SeamlessTabbing" VALUE="1">
 <PARAM NAME="Profile" VALUE="0">
 <PARAM NAME="ProfileAddress" VALUE="">
 <PARAM NAME="ProfilePort" VALUE="0">
 <PARAM NAME="AllowNetworking" VALUE="all">
 <PARAM NAME="AllowFullScreen" VALUE="false">
 <PARAM NAME="AllowFullScreenInteractive" VALUE="">
</OBJECT>

1 个答案:

答案 0 :(得分:1)

:)我认为我的帖子非常愚蠢,我自己回答问题:)

好吧,这是一个愚蠢的问题,但可能有一天它可能会帮助一些人。 我搞砸了属性&amp;的序列。 PARAMS


错误的序列

swfobject.embedSWF(swfUrl,“kcSwf”,swfWidth,swfHeight,flashVersion,“/ resources / expressInstall.swf”,flashvars,属性,参数);


正确的序列

swfobject.embedSWF(swfUrl,“kcSwf”,swfWidth,swfHeight,flashVersion,“/ resources / expressInstall.swf”,flashvars,参数,属性);