Loop or Var

Hey, If i wanted to loop a section of my timeline and then after a certain amount of times of the loop (say 5) go to another section, what would be the best way to achieve this, using a few variables or a loop statement.

I ve been trying variables, because my guess is that i need to have a counter, for the times loop, problem is Iam no good at variables. any help will be great.

what i got is,



totalcount = totalsum;
totalsum = 0;



and on the last frame



totalsum = +1;
if (totalcount=5) {
    gotoAndPlay(185);
} else {
    gotoAndPlay(240);
}


pretty bad aye.
(-:

i worked it out!!!

first



totalsum = 0;


last



totalsum = totalsum+1;
if (totalsum==5) {
    gotoAndPlay(185);
} else {
    gotoAndPlay(240);
}



i guess i am not too bad after all :beam: