Movie clip manipulation

Hi
In my main movie there is a movie clip called “trayopen” when I click on this movieclip it activates by animating to a stop in the movie clip I specified. I sort of have two asks that may be similar in nature…

I need a button on the main time line that will goto a frame on the main timeline but need the “trayopen” movie clip to then playout to the end frmo it’s current stopping point

As well as I need a button that is within the “trayopen” movieclip that will sort of do the same thing finishout playing the movieclip and go to a frame on the main timeline.

Here is the code I currently have to go to a frame on the timeline

myButton_btn.onRelease = function (){
gotoAndStop (6);
};

additinal note… the movie clip might not always have been activated by the user so can it check to see if the movieclip is at a particular frame before it decides to play it out?

Hope I am making sense =)