How to make an action to "go to next label"?

HI.
I want to do a slide show with a button to go forward. How can i make a button go to the next label?
I tryed this but it’s not working for some reason:


count=0;
myArr=["1","2","3","4","5","6"];
 
nextButton.onRelease=function(){
_root.gotoAndStop(myArr[count+1]);
count++;
}
prevButton.onRelease=function(){
_root.gotoAndStop(myArr[count-1]);
count--;
}