# Help with a gallery counting system... newb

**URL:** https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580
**Category:** flash
**Created:** [February 28, 2003, 1:07am UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580 "2003-02-28T01:07:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Atomica](https://avatars.discourse-cdn.com/v4/letter/a/94ad74/32.png) [@Atomica](https://forum.kirupa.com/u/Atomica)
#### Post date: [February 28, 2003, 1:07am UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580/1 "2003-02-28T01:07:34Z")

</div>

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](http://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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 28, 2003, 10:51am UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580/2 "2003-02-28T10:51:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 28, 2003, 12:21pm UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580/3 "2003-02-28T12:21:56Z")

</div>

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](http://photos.optikinesis.com/photojournal3.html)

\*here’s a link to an exampla fla of that  
[http://photos.optikinesis.com/resources/091402.fla](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](http://photos.optikinesis.com/resources/dynamicaddonesubone.html)

and the fla,  
[http://photos.optikinesis.com/resources/dynamicaddonesubone.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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 28, 2003, 1:41pm UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580/4 "2003-02-28T13:41:03Z")

</div>

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 🙂  
I have only edited code for clicking the arrows, not the key press functions.

Hope it helps =)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 28, 2003, 7:43pm UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580/5 "2003-02-28T19:43:16Z")

</div>

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. 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 28, 2003, 7:47pm UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580/6 "2003-02-28T19:47:36Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 28, 2003, 7:51pm UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580/7 "2003-02-28T19:51:11Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [February 28, 2003, 8:40pm UTC](https://forum.kirupa.com/t/help-with-a-gallery-counting-system-newb/14580/8 "2003-02-28T20:40:35Z")

</div>

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

you don’t need two handlers

just add **\_root.changePhoto(1);** to the script 🙂
