外部接口在 ie9 中不起作用
我在使用外部接口和 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>
然后是flash,这是我怀疑问题是...
if (ExternalInterface.available)
{
var CookieName:String = "unitsWeekTotal";
var CookieValue = unitsWeekTotal;
ExternalInterface.call("setCookie", CookieName, CookieValue);
}
然后是脚本标签内的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());
}
如果我忽略了已经存在的解决方案,任何帮助将不胜感激。我认为是闪存,因为我对闪存编码还很陌生。
提前致谢
I am having problems with External interface and IE9. The swf objects play fine but none of the information input is transferred to the cookies that should be set. I have seen that there are other questions similar to this but have not been able to solve my problem using them. THis is the html we are using
<div id="flashcentre">
<object type="application/x-shockwave-flash"data="http://workingflashlink" width="600" height="450">
<param name="movie" value="http://workingflashlink">
</object>
</div>
then the flash, this is were I suspect the problem is...
if (ExternalInterface.available)
{
var CookieName:String = "unitsWeekTotal";
var CookieValue = unitsWeekTotal;
ExternalInterface.call("setCookie", CookieName, CookieValue);
}
Then the Javascript inside script tags
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());
}
Any help would be greatly appreciated, if I have overlooked a solution that is already present. I think it is the flash because I am pretty new to flash coding.
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过将AllowScriptAccess 添加到您的Flash 嵌入中?没有它,Flash 就无法访问您浏览器的 javascript。
Have you tried adding AllowScriptAccess to your flash embed? Without it, Flash cannot have access to your browser's javascript.