AS2 forward and back buttons action for photo gallery


Sorry for the basic question but I am looking for a code to make a forward and a back button on a photo gallery.

I have my images one per frame on layer one, my forward button on layer 2 and my back button on layer 3. Whenever the forward button is press I need the animation to go to the next frame and when the back button is pressed to go to the previous one.

I tried

on (release) {

but it didnt work

Can someone help please?

thanks a lot