i using code (from kglad) load sequence of images alternating loaders, make sequence (silent) movie.
i have images , flash file in same folder. code works - loads sequence, getting securityerror: error #2000: no active security context.
should add url path somewhere, or 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 {
}
}
there's trying load doesn't exist. 13.jpg candidate.
use trace function pinpoint.
More discussions in ActionScript 3
adobe
Comments
Post a Comment