Photo Gallery - Back and Next function

Hi all,

I want to add two buttons in as2 for a photo gallery. The funtions must be: go to next picture or go back. I’ve created my buttons “imageBack” and “imageNext”.

I’m not familiar with scripting and I need to create the script that does this operation. Any ideas?

The current status of the gallery is this script that enables to go on the next image when i click on the image but i have no options to go back


over.onPress = function() {
    if (pic<total-1) {
        pic++;
        loadPic(pic);
    }
};

Cristian