How to loop through frames

Hi I have a question I want to be able to loop using gotoAndPlay 3 times through a certain section of frames in my flash movie after 3 times is up I want to be able to continue on to the next frames untill the end of the movie

I guess I am not much of a programmer because I tried good and hard to get this to work

I would like to hear your thoughts on how I could accomplish this thank you

maboroshi

It’s not the best but it will accomplish what you need,
On the third frame place:
[AS]
if(_root.counter == undefined){
_root.counter = 1;
gotoAndPlay(1);
} else if(_root.counter >= 3){
delete _root.counter;
gotoAndPlay(4);
} else {
_root.counter++;
gotoAndPlay(1);
}
[/AS]

There are lots of better ways to accomplish this but that should be the easiest to understand.
Hope that helps,
Shawn

Hey Thanks

It works great

Cheers

Andrew

Maboroshi

You could simply use

this.counter>=3 ? this.gotoAndPlay(4) : this.gotoAndPlay(1);
this.counter++;

Like I said there are better ways…