[FMX]Shorten movieclip

I have a movie clip that is about 80 frames. It just cycles through 4 pictures at 20 frames per pic. I want to use actionscript so I can cut down the number of frames. I thought I could use a while loop to do this. Here is what my code looked like:

stop();
x = 0;
while (x<1001) {
x++;
}

if (x == 1000) {
gotoAndStop(2);
}

Would something like this work?

Hmm, I am not quite sure what that means. I attached that code to my movie clip and it just stayed at the first image. Do I need to define “i” as something? I tried setting it to 0 and 20 not knowing what that would do.

search the fourm for setInterval or look it up in help. You can use that to pause the movie for a certain amount of time.

Thanks, it works now, but it only goes through once. Can I make it so it loops an infinite amount of times?

change [AS]i++;[/AS]to[AS]if (i == numberofpictures*20+20) {
i = 0;
} else {
i++;
}
[/AS]change numberofpictures to the number of pictures you have

Thanks a lot, it works now. Sorry to be a nuisance, but I have one last question, could you possibly explain what that code does. I now what the onclip commands do, but I don’t understand what is going inside of the enterFrame section.