When I tried putting the code in the first frame and tried getting it on the whole movie it didn't work. I use stops a lot and whenever I used it, it would make the code for the buttons go away. That's when the code became HUGE. After every stop I would have to write new code for all the buttons again.
And when I tried make 2 action layers, one for the buttons and one for the stops the movie wouldn't go anywhere.
I think that my problem is that I am not understanding how the Keyframes work on the actions layers. On other layers if you put one keyframe in the beginning and one at the end the whole movie would contain whatever was on that layers. With the actions it's not like that, I put all the code for all the main buttons on the first frame and add a key frame at the end. Whenever I put the Stop action it would remove the code from the frames that come next.
Hope I am making sense At least in my head it does.
You only need to define the buttons in the first frame. Think of it like this. The main timeline is where you can set the variable and properties of your functions that will be present for the entire duration of your "Movie"
setting them in frame 1 is all you need to do for the movie to remember the details but you must make sure that the buttons are present in every frame, i.e select the last frame of your movie, on the buttons layer, and "Insert Frame" so that the frames are filled through the entire scene.