Array looping

Hi all,

I am new to this forum and AS3 I find it very interesting and full of useful info. Just started my new adventure with AS3 and already encounter a few problems.

What I try to do is to loop into an array with movieclips and play them as long as the user is going to stay on the page with the swf( the main page). I tried different ways to achieve this but here I am, after 3 days of digging with no usable results yet:( .
My code looks like this :

var newMovie.Photo1 = new Photo1();
var newMovie1.Photo2 = new Photo2();
var newMovie2.Photo3 = new Photo3();
var aMovies:Array = new Array(newMovie,newMovie1,newMovie2);
var count:Number = aMovies.length;
var i:Number = 0;

while(i<count){
addChild(aMovies*);
aMovies*.addEventListener(Event.ENTER_FRAME,nextmove);
i++;
if (i==count) {
i=0;
}

}
function nextmove(evt:Event):void {
if (aMovies*.currentLabel==“end”) {
aMovies*.gotoAndStop(“end”);
aMovies*.removeEventListener(Event.ENTER_FRAME,nextmove);
addChild(aMovies[i+1]);
aMovies[i + 1].gotoAndPlay(1);
}
}

What I get is an error like this:

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at banner2_fla::MainTimeline/banner2_fla::frame1()

Not sure if the infinite loop is a solution for my problem but I couldnt figure out any other solution.

Can anyone help me with this please ?

Thank you !