Skipping frames

Hi, I’m new to flash and have a question I can’t find an answer to. I have a next button that needs to function on every frame of my movie. But the frames are not run in order so the first frame will not allways be run first. So if I jump around in the movie, my buttons stop fuctioning as the first frame is not being played. So I tried Putting the code on each frame with a different name to aviod duplicate function error. But now when I click the next button it is skipping several frames and no longer going to the next one. How do I get around this?

Thanks in advance for any advice.