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 {
}
}
Oh dear!!
I rechecked to verify the actual images are consistent w/those in the code only to discover that jpg # 7 was written w/an error, as such "7 .jpg", rather than thus "7.jpg" - i.e. w/ a space between the 7 and dot. Fixed it and the code is good, no error.
THnks a million kglad (again)!
North America
Europe, Middle East and Africa
Asia Pacific