Looping through swf files

Hi guys,

I’m somehow a newbie with AS and flash so i need to a script that loops through, let say 1-* swf files here what i did and i’m probably missing something OR i’m just not right at all

var my_array:Array = my_str.split(",");
var loader:Loader = new Loader();
var mc:MovieClip;

function callback (){

var swf:URLRequest = new URLRequest(my_array*);

loader.load(swf);

addChild(loader);
    
loader.contentLoaderInfo.addEventListener("complete",movieComplete);

i++;
if( i == my_array.length){ //chk if it's the end of my swf array put it back to 0
    i =0;
}

}

function movieComplete(event:Event):void {
mc = new MovieClip();

 mc.addChild(loader);

 addChild(mc);

  mc.addEventListener(Event.ENTER_FRAME, checkIsLast);

}

function checkIsLast(e:Event):void{
//trace(mc.currentFrame +":"+ mc.totalFrames);
//trace(mc);

if(mc.currentFrame == mc.totalFrames){ //changed this
    trace("done");
 }

}

callback();

pleaaaase help me, i need this for my project :slight_smile:

thx