Flash Action Script Error Repository

A library of solutions to Actionscript, Flash, Flex and AIR

SecurityError: Error #2000: No active security context.

SecurityError: Error #2000: No active security context.

Problem:
i don't know. it usually happens with setTimeout and calls to file reference class. just received this when i tried to access a reference to the Capabilities class:

Actionscript:
  1. var cap:* = Capabilities;
  2. dpi1.text = String(Capabilities.screenDPI);

However, after testing it again just now the error disappeared. It may be Flash Builder didn't or couldn't give permissions to swf in time (file was locked?). Please post your scenarios. It may be an issue with global functions like navigateToURL or classes declared final.

Solution:
for setTimeout issues wrapping the call in an anonymous function works around it like so:

Actionscript:
  1. setTimeout( function():void{fileReference.load();}, 1);

more info...

also try restarting your environment or making changes and debugging again.

Please post your comments to help future visitors.

No comments yet. Be the first.

Leave a reply

Wrap MXML and ActionScript in [xml] [/xml] and [as] [/as] tags respectively