# More newb script questions

**URL:** <https://forum.kirupa.com/t/more-newb-script-questions/210194>\
**Category:** Uncategorized\
**Created:** [December 15, 2006, 11:44pm UTC](https://forum.kirupa.com/t/more-newb-script-questions/210194 "2006-12-15T23:44:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mellowvw](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@mellowvw](https://forum.kirupa.com/u/mellowvw)\
**Post date:** [December 15, 2006, 11:44pm UTC](https://forum.kirupa.com/t/more-newb-script-questions/210194/1 "2006-12-15T23:44:24Z")

</div>

## I am making a portfolio for my website and here is the beginning of my script.

stop();

//setting up the list of frame names for the buttons  
imagelist = [“horror”,“legs”,“chair”];

//‘next’ button setup  
next\_b.onRelease = function() {  
gotoAndPlay (imagelist[0]);  
}

* * *

Now i want the button to cycle through the arrays so that everytime you hit the button it goes to the next frame instance that i’ve named. In this case imagelist[0] is horror so next time you hit button i want it to goto imagelist[1] or ‘legs.’ Also I need to set a stop action for this (im guessing loop) so that it stops at the array length.

Thanks for your time & help!
