SecurityError: Error #2000: No active security context.
Always interesting to throw an error that has only 4 obscure results in google.
Using setTimeout with navigateToURL:
var urlRequest:URLRequest = new URLRequest("http://google.com");
setTimeout(navigateToURL, 1000, urlRequest, "_blank");
setTimeout(navigateToURL, 1000, urlRequest, "_blank");
Generates:
SecurityError: Error #2000: No active security context.
at global/flash.net::navigateToURL()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at <anonymous>()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
A work around is to wrap the call in an anonymous function:
setTimeout(function():void { navigateToURL(urlRequest, “_blank”); }, 1000);
well, i get this error when trying to access the data property of a filereference… :) weird stuff
I just joined this tragic club… What the hell is this error about? I get it when using LocalConnection within FlexBuilder 3 (in Eclipse).
I’m with you pallzoltan. When trying to access the data property of a filereference.
@pallzoltan
The filereference.data error can also be fixed with the setTimeout or timer function.
For filereference.data to work as expected, the load() function has to be wrapped:
setTimeout( function():void{fileReference.load();}, 1);
Maybe there are some more elegant ways to achieve this, however it works for me.
FYI, I just wasted a few hours because the FlexBuilder debugger displays this message until the getter is actually accessed in the code. Apparently, the debugger runs in a separate security context. As it turns out, this “error” wasn’t even a problem. So for a bit of advice, try doing a trace(“” + loader.content) before you jump to conclusions.
Can anyone explain what this error even means? I’m getting it trying to use setTiemout to delay the intitial start a Timer:
setTimeout(myTimer.start, 1000)