Name the button "button" and just use this code that makes the button go to next frame you can also do prev frames

button.onRelease = function() {
nextFrame();
};