Looping A Flash Banner A Set Number Of Times

I don’t do much Flash work these days, but sometimes something falls into my lap. I can animate pretty well in the application and I know my way around some of the basic ActionScript but there always seems to be a bit more ActionScript that I need that goes just beyond my knowledge. The other day I needed to loop a banner three times. I could just do a quick google search and find something that might work but I find that some of the things you find are not always the best option. My goto person for these sorts of questions is my buddy Matt Stone. He pointed me to a very useful script that he has used in the past. What you do is add this ActionScript to the end of the timeline.

if (counter == undefined){
counter = 1;
}
if (counter <3){
counter++;
gotoAndPlay (1);
}else {
//stop looping
stop();
}

Related Posts:

Tags: ,

Leave a Reply