Add a new layer called "actions". Insert a keyframe at the very beginning of your animation and then insert other keyframe at the very end.
if(!this.loopsPlayed) {
this.loopsPlayed = 0;
}
this.loopsPlayed++; console.log(this.loopsPlayed);
if (this.loopsPlayed >= 2) {
this.stop();
} else {
this.gotoAndPlay(0);
}
If you want to have the animation play 3 times just change the "2" to a "3".
That's it. :)
It worked great for me, but what if I want it to loop infinitely until another button tells it to got to a different part of the timeline? Thanks!