Navigating between frames in mc

Hi.

Ok so I got a mc and inside it on every frame are different mcs that play one after the other. So when each is finished it goes to the next frame in the parent mc and plays the mc in its frame. I want to have next and previous buttons to control which mc to play and go through them quickly if need be. I’ve got code for it but the buttons for previous and next frames don’t do the trick - they just don’t do anything. I’m figuring Flash doesn’t like me suddenly stopping the mcs inside the frames to move to another frame ya know. But I don’t know what to do.

This is my code for the parent mc:

package script {

import flash.display.MovieClip;
import flash.events.MouseEvent;

public class count_ducks_mc extends MovieClip {

    public function count_ducks_mc() {
        count_ducks_next_btn.addEventListener(MouseEvent.CLICK, next);            
        count_ducks_back_btn.addEventListener(MouseEvent.CLICK, back);    
    }
    
    function next(e:MouseEvent) {
        gotoAndStop(nextFrame);
    }
    
    function back(e:MouseEvent) {
        gotoAndStop(prevFrame);
    }
}    

}