Gallery help, next/previous buttons not working

Hey :slight_smile:

My question is in reference to the hybrid gallery described here http://www.kirupa.com/forum/showthread.php?t=202184

Basically I am attempting to create a next and previous button for this particular version of the gallery. I know what’s going wrong, I just don’t know why. Here’s my code:


function dopress() {
 for (var i = 0; i<cliparray.length; i++) {
  scroll.paper["btn"+i].thmb.gotoAndStop(1);
  cliparray*._visible = 0;
  if (scroll.paper["btn"+i].okay == true) {
   scroll.paper["btn"+i].enabled = true;
   scroll.paper["btn"+i]._alpha = 100;
  }
 }
trace(this)
 this.enabled = false;
 border.resizeMe(myarray[this.ivar].holder, myarray[this.ivar].holder._width, myarray[this.ivar].holder._height, this.ivar+1);
 info.text = myarray[this.ivar].title;
 this._parent._parent._parent.next.onRelease = function() {
  if (ivar<cliparray.length-1) {
   ivar++;
   doPress();
  } else {
   ivar = 0;
   doPress();
  }
 };
prev.onRelease = function() {
 if (ivar>0) {
  ivar--;
  doPress();
 } else {
  ivar = cliparray.length-1;
  doPress();
 }
}

[FONT=Courier New][/FONT]

The code works fine if I just navigate the gallery pictures via the prev/next buttons, the problem arises when I click on one of the thumbs itself. When I do a trace within the doPress() function, if I click on the prev or next button and then click back on a thumb, somehow “this” becomes _level0, instead of “_level0.scroll.paper[“btn”+i]” as it should be. So I think I’m not calling the ivar variable correctly, but everything I’ve tried has failed. Any help would be appreciated. :slight_smile:

-Swan