Skip navigation
Currently Being Moderated

array loads a sequence of image in the same folder: it works, but why the security error #2000?

Jun 27, 2012 12:33 AM

i am using this code (from Kglad) to load a sequence of images into alternating loaders, to make the sequence look like a (silent) movie.

 

I have the images and the flash file in the same folder. The code works - loads the sequence, but i am getting SecurityError: Error #2000: No active security context.

Should i add a url path somewhere, or is anything missing?

 

 

var count:int;

 

var imageArray:Array=["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7. jpg","8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg"];

 

var ldr0:Loader=new Loader();

ldr0.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);

 

var ldr1:Loader=new Loader();

ldr1.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);

 

 

btn.addEventListener(MouseEvent.CLICK,clickF);

 

function clickF(e:MouseEvent):void{

    count=0;

    loadF();

}

 

function loadF():void{   

    addChild(this["ldr"+count%2])  

    this["ldr"+count%2].load(new URLRequest(imageArray[count]));

 

}

 

 

function loadCompleteF(e:Event):void{

        count++;

    if(count<imageArray.length){

         if(this["ldr"+count%2].content){

       

         this["ldr"+count%2].unloadAndStop();

    }

    loadF();

 

    } else {

   

    }

 

}

 
Replies
  • kglad
    62,219 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 27, 2012 6:52 AM   in reply to minimalcomfort

    there's something you are trying to load that doesn't exist.  13.jpg is a likely candidate.

     

    use the trace function to pinpoint.

     
    |
    Mark as:
  • kglad
    62,219 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 1, 2012 5:47 AM   in reply to minimalcomfort

    you're welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points