# Noobish question

**URL:** <https://forum.kirupa.com/t/noobish-question/322883>\
**Category:** Uncategorized\
**Created:** [June 7, 2011, 1:35pm UTC](https://forum.kirupa.com/t/noobish-question/322883 "2011-06-07T13:35:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katumi](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@Katumi](https://forum.kirupa.com/u/Katumi)\
**Post date:** [June 7, 2011, 1:35pm UTC](https://forum.kirupa.com/t/noobish-question/322883/1 "2011-06-07T13:35:29Z")

</div>

Hello everyone 🙂 Noobish question here…

I have a movieclip called myButton, inside of myButton i have a textfield called buttonLabel.  
I have 16 instances of myButton placed on the stage with instancenames myButton1, myButton2, etc.

I want the textfield inside of each button to display the same number as the one in their instance name. ie myButton1.buttonLabel.text = “1”.

instead of repeating that line of code 16 times, is there a way i can use a loop?  
something like  
for (var i:int = 1; i \< 17; i++)  
{  
myButton(i).buttonLabel.text = i  
}

obviously that doesn’t work, otherwise i wouldn’t be asking, i’m just trying to explain what i’m trying to do… if anyone understand and know the solution i would be very interested in hearing it 🙂 Thanks in advance! : )
