Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7186015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:32:34+00:00 2026-05-28T18:32:34+00:00

I am trying to load a swf file which contains xml based image gallery

  • 0

I am trying to load a swf file which contains xml based image gallery on 25th frame of the timeline inside flash professional cs5.5 using actionscript 3. while doing so i’m getting this error “SecurityError: Error #2000: No active security context”. Below is the as3 code:

stop();

import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;

function startLoad() { 
    var mLoader:Loader = new Loader();
    var mRequest:URLRequest = new URLRequest("../xml_gallery_2_852/XMLGALLERY2.swf");
    mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
    mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler); 
    mLoader.load(mRequest);
} 

function onCompleteHandler(loadEvent:Event) {
    addChild(loadEvent.currentTarget.content);
} 

function onProgressHandler(mProgress:ProgressEvent) {
    var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;        
    trace(percent); 
}

startLoad();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:32:35+00:00Added an answer on May 28, 2026 at 6:32 pm

    Security errors are thrown when an operation is not permitted by the security sandbox the application runs in. This can have several reasons – not the least of which would be trying to access a local file from an application that was compiled with use-network=true.

    EDIT

    Re-reading your question I have come across the most possible cause, but I’ll leave the other info in, anyway – it might be useful to other users.

    You are loading an image gallery, which in turn loads other files (XML), but the external SWF was compiled with the use-network option, while your FLA automatically runs as local-trusted application when exported from the Flash IDE. This is of course a sandbox violation.

    You can test this by starting your SWF from a web server that has a valid security policy – if I assume correctly, your app should work then.

    By the way, if you add an event listener to the contentLoaderInfo to handle security errors, you can prevent your app from crashing and exit gracefully.

    END EDIT

    The error could be related to a short delay in between instantiation of the loader and initialization of its security context. See this blog post for details.

    If this is true, you should be able to properly get rid of the error by delaying the load request using setTimeout() or moving the declaration of your loader outside of the function block, i.e.:

    var mLoader:Loader = new Loader();
    
    function startLoad() { 
        var mRequest:URLRequest = new URLRequest("../xml_gallery_2_852/XMLGALLERY2.swf");
        mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
        mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler); 
        mLoader.load(mRequest);
    } 
    

    Declaring your loader as a temp variable is “dirty” anyway: The reference is lost, but the event listeners you’ve added to contentLoaderInfo keep it alive in memory, regardless of whether it is still needed or not. This can lead to serious memory leaks, if you’re going to load more than one file. You should always keep a reference to your loader, if you want to properly dispose of loaded content when it is no longer needed (by using Loader.unload()), and to make the loader itself available for garbage collection (by removing event listeners and explicitly setting the reference to null after use).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to load an xml file from wikipedia into my flash movie.
I'm trying to load an image file that's right next to the .SWF file.
I'm trying to load a swf file into my main swf. Everything looks fine
I am trying to load an external swf file. The swf width and height
I'm trying to load an swf file using SWFLoader in Adobe AIR app. The
I am trying to load an SWF inside a WebView in my cococa app,
I'm trying to load an swf file and dynamically determine its height and width.
I am trying to capture a still frame from an (any) external swf file,
Im trying to load a flash movie using swfobject which i have been successful
I am trying to use URLLoader to load an XML file from server (same

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.