【问题标题】:ExternalInterface not working in ie9外部接口在 ie9 中不起作用
【发布时间】:2012-02-06 10:49:55
【问题描述】:

我在使用外部接口和 IE9 时遇到问题。 swf 对象可以正常播放,但没有任何信息输入传输到应设置的 cookie。我已经看到还有其他类似的问题,但无法使用它们解决我的问题。这是我们正在使用的html

<div id="flashcentre">
<object type="application/x-shockwave-flash"data="http://workingflashlink" width="600"  height="450">
<param name="movie" value="http://workingflashlink">
</object>
</div>

然后是闪光灯,这是我怀疑的问题是......

if (ExternalInterface.available) 
{ 

var CookieName:String = "unitsWeekTotal"; 
var CookieValue = unitsWeekTotal; 

ExternalInterface.call("setCookie", CookieName, CookieValue);
} 

然后是script标签里面的Javascript

function setCookie(CookieName, CookieValue, expiredays)
{value=CookieValue;

var ExpireDate = new Date ();

ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));

document.cookie = CookieName + "=" + escape(value) +

((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

如果我忽略了已经存在的解决方案,我们将不胜感激。我认为这是闪存,因为我对闪存编码很陌生。

提前致谢

【问题讨论】:

    标签: javascript flash internet-explorer-9 externalinterface


    【解决方案1】:

    您是否尝试过将 AllowScriptAccess 添加到您的 Flash 嵌入中?没有它,Flash 将无法访问您浏览器的 javascript。

    <param name="allowscriptaccess" value="always" />
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-22
      • 1970-01-01
      • 2020-05-07
      • 2017-02-03
      相关资源
      最近更新 更多