Skip to main content
Participating Frequently
December 3, 2013
Question

SecurityError: Error #2000: No active security context.

  • December 3, 2013
  • 6 replies
  • 897 views

When I try to load an external image from a folder called assets, this is the error I get:

SecurityError: Error #2000: No active security context.

My code is:

http://pastebin.com/pkXAV7Hw

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

Adobe Employee
December 3, 2013

looks like a path issue, try installing an event handler for IOErrorEvent.IO_ERROR on the loader.contentLoaderInfo for more details. You can check the example at the end of this page: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/LoaderInfo.html. for reference.

-Dharmendra

KodiCodAuthor
Participating Frequently
December 3, 2013

I didn't understand the soultion, can you show a code that I can use?

I'm pretty much a beginner

Adobe Employee
December 3, 2013

You can try the following in your case. The function ioErrorHandler should give you more details if there is a path issue.

import flash.display.Loader;

import flash.net.URLRequest;

import flash.events.*;

var loader:Loader = new Loader();

loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

loader.load(new URLRequest("assets/boats.jpg"));

addChild(loader);

function ioErrorHandler(event:IOErrorEvent):void {

          trace("Error: " + event);

}