Play until frame (#)... will it work?

So what I’m trying to do is have each button play until a certain frame. Let me dumb it down and map it out:

The animation is 29 frames:
First Frame : Square
2-9 : Tween
10th Frame : Circle
11-19 : Tween
20th Frame : Star
21-29 : Tween (it automatically goes back to frame #1)

*There are three buttons that are allways in the animation
Button One is a Square
Button Two is a Circle
Button Three is a Star

I want each button to play until it reaches the matching frame (i.e. When you are on the circle frame and press the square button, it plays through the star animation and back to frame one. When on the star frame and you press circle, it playes through the quare animation to thec and stops on the circle frame).

I’m sure there is a way to do this, I just can’t think of it right now.

Thank you in advance.