Need some help... tracking mouse click + state of button

I don’t know if I’m approaching this correctly…probably not as I can’t get it work. Need some help here.

Movieclip A is playing in the foreground on the main stage, when button B(on the main stage) is clicked, it plays frame 10-15 of Movieclip A and after it played it will goes to Movieclip B. And if button C is clicked, it will check if Movieclip A or B is on the main stage, if it is it will play Frame 10-15 of MovieClip A or B depends which is on the foreground playing and after it played, it will goes to MovieCip C… and so on…

Here is the code I tried…