# Button array & Prev/NextImage buttons interaction. How can I do this?

**URL:** https://forum.kirupa.com/t/button-array-prev-nextimage-buttons-interaction-how-can-i-do-this/163877
**Category:** Uncategorized
**Created:** [September 27, 2005, 12:16am UTC](https://forum.kirupa.com/t/button-array-prev-nextimage-buttons-interaction-how-can-i-do-this/163877 "2005-09-27T00:16:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![motionsync](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/motionsync/32/781_2.png) [@motionsync](https://forum.kirupa.com/u/motionsync)
#### Post date: [September 27, 2005, 12:16am UTC](https://forum.kirupa.com/t/button-array-prev-nextimage-buttons-interaction-how-can-i-do-this/163877/1 "2005-09-27T00:16:52Z")

</div>

Hi  
In my Photo gallery I have a buttons array that i like to interact with my Previous and Next button

Like it is now ( take a look att [www.apneaimages.com](http://www.apneaimages.com) ) when I push one of the buttons they turn BLUE and stay there (visited)  
But I like that they turn blue when I use the prev and next Button

my Button array is:

```auto
myButtons = [btn1, btn2, btn3];

```

Then the Next Button script is:

```auto
function nextImage() {
 clearInterval(myInterval);
 if (cur == pArray.length-1) {
  containerMC.loadPic(0);
 } else {
  containerMC.loadPic(cur+1);
 }
}

```

There must be a way to arhive this if I use the cur & pArray but how can I do this?
