引发SecurityError:错误#2000:没有活动的安全上下文 [英] SecurityError: Error #2000: No active security context

查看:2147
本文介绍了引发SecurityError:错误#2000:没有活动的安全上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我有这个模糊的错误发生在我身上的使用LocalConnection的。
它发生每次我试图连接并发送数据到另一个SWF的时间。 做一个互联网搜索提出了一点成绩有关的LocalConnection这个错误,并且响应已经有很多人只是可笑。 显然,这错误涉及图像加载和的FileReference也,只是没有在这种情况下。 我送code正常工作,甚至event.level返回的状态,这意味着其他SWF得到的消息,但是一丝的其它SWF回调函数并没有表现,告诉我永远不会触发回调。

图片加载错误
我被钉在这一个再次加载图像。
答案已更新为包括此修复也。

I recently had this vague error happen to me with the use of LocalConnection.
It happened every time I tried to connect and send data to another swf. Doing an internet search came up with little results pertaining to LocalConnection and this error and the response some people had were just ridiculous. Apparently this error pertains to image loading and fileReference also, just not in this case. My sending code works fine, even the event.level returned as status which means the other swf got the message, however a trace in the other swf callback function did not show, telling me the callback never triggered.

Image loading error
I got nailed on this one again with loading images.
The answer has been updated to include the fix for this also.

推荐答案

事实证明的解决方法是简单的。
连接名称太长。
我将这个名字下降到30个字符,并立即开始工作。
我也想补充一点,如果有错误的回调函数,你会得到这个错误。

图片加载错误
那么这个错误突然出现在我一次,但这次当我加载图像。

As it turns out the fix is simple.
The connection name was too long.
I cut the name down to 30 characters and it started working immediately.
I also want to add that if there is an error in the callback function you will get this error.

IMAGE LOADING ERROR
Well this error popped up on me again, but this time when I was loading images.

// bad code
imageObj.source = partialURL1 + partialURL2 + partialURL3;

//good code
var someURL:String = partialURL1 + partialURL2 + partialURL3
imageObj.source = someURL;

看来你不能追加的网址你为它分配在同一行。看起来像一个调试器的bug。即使在恶劣code HTTPFox是显示图像加载的地方,但程序会废话了某处源分配后,可能在onloaded回调。我停下来调查此事时,我发现了源分配固定它。

It seems you can not append the URL on the same line you assign it. Looks like a debugger bug. Even with the bad code HTTPFox was showing the images where loading, but the program would crap out somewhere after the source assignment, probably on the onloaded callback. I stopped looking into the matter when I found the source assignment fixed it.

这篇关于引发SecurityError:错误#2000:没有活动的安全上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆