Three of those are the same action, where one of them is the special case of being the current frame. There are already code snippets for stop at this frame and get the current frame number, as well as snippets to go to another frame and stop or play. What you're asking for is either a slight change to one of the existing snippets, or a matter of combining two of them.
For example, to go to the next frame would be a combination of getting the current frame, adding 1 to that, and going to the calculated frame. Here's the snippet for getting the current frame (with comments removed, and in my examples the object clicked on is named 'clip'):
var frameNumber = this.currentFrame;
and the snippet for going to another frame and stopping:
this.clip.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this));
function fl_ClickToGoToAndStopAtFrame() {
this.gotoAndStop(5);
}
So, you want the next frame instead of hard coding '5', like this:
this.clip.addEventListener("click", fl_ClickToGoToAndStopAtNextFrame.bind(this));
function fl_ClickToGoToAndStopAtNextFrame.bind() {
this.gotoAndStop(this.currentFrame+1);
}
The snippets get you started, but you do at some point have to understand what the snippets are doing, so you can modify them for a slightly different task.
Here's the code for the four things you asked about:
1. on click go to next frame
this.clip.addEventListener("click", fl_ClickToGoToAndStopAtNextFrame.bind(this));
function fl_ClickToGoToAndStopAtNextFrame() {
this.gotoAndStop(this.currentFrame+1);
}
2. on click go to previous frame
this.clip.addEventListener("click", fl_ClickToGoToAndStopAtPreviousFrame.bind(this));
function fl_ClickToGoToAndStopAtPreviousFrame() {
this.gotoAndStop(this.currentFrame-1);
}
3. on click play
this.clip.addEventListener("click", fl_ClickToPlay.bind(this));
function fl_ClickToPlay() {
this.play();
}
4. on click stop
this.clip.addEventListener("click", fl_ClickToStop.bind(this));
function fl_ClickToStop() {
this.stop();
}