# Populating text fields w/ for(){}

**URL:** <https://forum.kirupa.com/t/populating-text-fields-w-for/235924>\
**Category:** flash\
**Created:** [August 15, 2007, 7:48pm UTC](https://forum.kirupa.com/t/populating-text-fields-w-for/235924 "2007-08-15T19:48:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![switchBack](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@switchBack](https://forum.kirupa.com/u/switchBack)\
**Post date:** [August 15, 2007, 7:48pm UTC](https://forum.kirupa.com/t/populating-text-fields-w-for/235924/1 "2007-08-15T19:48:02Z")

</div>

Hey guys I’m trying to populate a set of dynamic text fields with text using a for() loop and cant seem to get it to work.

I have 9 seperate dynamic text boxes each labled picNum0 - picNum8. I want to read a number of pictures from an external file then have those numbers populate 1 through 9 into the text fields.

I get the variables loaded in with the correct values but the text fields wont populate.

here is what I have so far:

pics = 4;

for(i=0; i\<pics; i++){  
curPic = (“picNum”+i);  
curPic.text = i;  
};

Pretty simple, but I can’t get it working.

When I trace(curPic) inside the for(){} it outputs: picNum0 - picNum8, so I know that the variables are allocating ok, but dynamic text fields arent populating with the correct numbers.

Any ideas?  
Thanks.
