I’m trying to load a successive series of swf, each containing audio, into a loader. As each ends, it’s unloaded and the next one loads. I’m using the following code:
var ldr:Loader = new Loader();
var c:int = 0;
var clips:Array = new Array("dmt1.swf","dmt2.swf","dmt3.swf","dmt4.swf")
addChild(ldr);
ldr.load(new URLRequest(clips[0]));
addEventListener(Event.ENTER_FRAME, loading);
function loading(e:Event){
if((MovieClip(ldr.content) != null)&&(c < 4)){
if(MovieClip(ldr.content).currentFrame == MovieClip(ldr.content).totalFrames){
ldr.unload();
removeChild(ldr);
ldr = null;
/c ++;
ldr.load(new URLRequest(clips[c]));
}
}
}
Each swf loads just fine, but the audio from the previously loaded swf start playing again, so there’s a layered audio mishmash. What am I doing wrong here??
Many thanks!