# Need a loop

**URL:** <https://forum.kirupa.com/t/need-a-loop/196241>\
**Category:** Uncategorized\
**Created:** [August 7, 2006, 4:06am UTC](https://forum.kirupa.com/t/need-a-loop/196241 "2006-08-07T04:06:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robinkmedia](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@robinkmedia](https://forum.kirupa.com/u/robinkmedia)\
**Post date:** [August 7, 2006, 4:06am UTC](https://forum.kirupa.com/t/need-a-loop/196241/1 "2006-08-07T04:06:16Z")

</div>

This code is begging to be in a loop-  
The only thing changing from button to button is the number.  
It would be awesome if someone could help me truncate this- my syntax isn’t where I’d like it to be yet…  
Thanks in advance!

thumb1.onRelease = function () {  
thumber (pic1);  
\_parent.credit\_txt.text = pic1Text;  
currentPic = 1;  
};  
//  
//  
thumb2.onRelease = function () {  
thumber (pic2);  
\_parent.credit\_txt.text = pic2Text;  
currentPic = 2;  
};
