外部接口在 ie9 中不起作用

发布于 2025-01-03 00:48:06 字数 1030 浏览 0 评论 0原文

我在使用外部接口和 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜空下最亮的亮点 2025-01-10 00:48:06

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

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

Have you tried adding AllowScriptAccess to your flash embed? Without it, Flash cannot have access to your browser's javascript.

<param name="allowscriptaccess" value="always" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文