Need some guidance about action-script in keyframes

i have a problem
i have
3 keyframes each has 30 frames and two arrow buttons
At each keyframe is loaded an image. I created a next button that when pressed would jog through each keyframe. Can somebody tell me the action script I would need for the next button?

and what is a handler???

cause i try this code
nextButton.onRelease = function(){
//set the root time line ahead 10 frames
_root.gotoAndPlay(_currentFrame+10);
}
and then an error is show
it says Statement is appear within on handler