# AS2 forward and back buttons action for photo gallery

**URL:** https://forum.kirupa.com/t/as2-forward-and-back-buttons-action-for-photo-gallery/300978
**Category:** flash
**Created:** [December 1, 2009, 7:12pm UTC](https://forum.kirupa.com/t/as2-forward-and-back-buttons-action-for-photo-gallery/300978 "2009-12-01T19:12:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ana81](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Ana81](https://forum.kirupa.com/u/Ana81)
#### Post date: [December 1, 2009, 7:12pm UTC](https://forum.kirupa.com/t/as2-forward-and-back-buttons-action-for-photo-gallery/300978/1 "2009-12-01T19:12:35Z")

</div>

Hey,

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) {  
\_root.changePhoto(-1);   
}

but it didnt work

Can someone help please?

thanks a lot
