_parent.content.[variable].gotoAndPlay() ???

Hello,

I have some code that duplicates a movie called movieclip1 as movieclip2, movieclip3, movieclip4, etc. That movieclip has another clip inside of it and I want to be able to activate that clip like so:

numMovies=4
while(numMovies>0) {
_parent.content.[“movieclip”+numMovies].gotoAndPlay(4);
numMovies–;
}

But that doesn’t work. The only thing I’ve been able to find is for movieclips directly at _root or “this” that can be accessed like this[“movieclip”+numMovies].gotoAndPlay(4) but my movie clip isn’t at _root or in the current clip. It’s within a bunch of movie clips. So basically I want to use gotoAndPlay with a relative path to the movie clip and a variable move clip name.

The number of movieClips changes and rather than defining a fixed number of movies I’d rather gotoAndPlay only the movies that are actually there…

Any ideas?

  • Bart
numMovies = 4;
while (numMovies > 0) {
 _parent.content["movieclip" + numMovies].gotoAndPlay(4);
 numMovies--;
}