Help with a gallery counting system... newb

Hey, I’m a bit of newbie when it comes to AS, but I’ve got flash animation down pretty well. I’m working on a photojournal system, based on the kirupa.com photo gallery tutorial, and I’m working on customizing it. Part of this being a image count number(dynamictext named ‘viewed’) that changes each time the button’s pushed forward or backward, but is limited to the number of photos…

I’m currently at this point:

for my back button I have this:

on(release){
if(_root.viewed < 60){
_root.viewed–
}
}

and for my forward button I have this:

on(release){
if(_root.viewed < 60){
_root.viewed++
}
}

Now the problem is that well, the backbutton goes into negatives once it gets down to zero, and the forward button stops at 60… but the gallery loops, it goes from the last image to the first when you go forward and vice versa going back ward, is there anyway I can get this to go 0 to 60 backward and forward with AS?

Please help if you can, thanks a billion.

If you could post the fla mate i will have a mess about with it and see what i can do :smiley:

Ok thanks, there’s a few parts to it

this is what the final product will look like ( but with the number system added)
http://photos.optikinesis.com/photojournal3.html

*here’s a link to an exampla fla of that
http://photos.optikinesis.com/resources/091402.fla

And here, here is the idea I’ve been led to for the counting system
http://photos.optikinesis.com/resources/dynamicaddonesubone.html

and the fla,
http://photos.optikinesis.com/resources/dynamicaddonesubone.fla

Hopefully that will express what I’m trying to do… basically count up to a set max number, then when that numbers hit, start back at one again, and vice versa when going in reverse, go 1… 60…59… etc. Thanks for your help.

I think i understand what you are after and i think this achieves what you want.

If i have miss understood whatt you want please correct me and feel free to ask any questions although the code is commented :slight_smile:
I have only edited code for clicking the arrows, not the key press functions.

Hope it helps =)

Thanks so much, it seems to be exactl what I was going for, now hopefully i can seemlessly add it to my photo galleries… btw you rock. :slight_smile:

Ok, newbie syntax question, how would I add the script you gave me to this existing script I’ve got for my buttons…?

on (release) {
_root.changePhoto(1);
}

Could I just add another on(release) statement to it?

well if u need any more help you know where i am :D, but i begginer action scripter myself

Could I just add another on(release) statement to it?

you don’t need two handlers

just add _root.changePhoto(1); to the script :slight_smile: