Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

SecurityError: Error #2000: No active security context.

New Here ,
Dec 03, 2013 Dec 03, 2013

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

TOPICS
ActionScript
821
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 03, 2013 Dec 03, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2013 Dec 03, 2013

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

I'm pretty much a beginner

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 03, 2013 Dec 03, 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);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2013 Dec 03, 2013

I got this:

Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2035: URL Not Found. URL: file:///C|/Users/PCName/Desktop/assets/boats.jpg"]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 03, 2013 Dec 03, 2013

Well that's the problem.

URL Not Found. URL: file:///C|/Users/PCName/Desktop/assets/boats.jpg"

Just check the path, and change your code accordingly, that should work.

-Dharmendra

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2013 Dec 03, 2013
LATEST

I put the full path and it still didn't work:

"C:\Users\PCName\Desktop\assets\boats.jpg"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines