# Changing instance name

**URL:** <https://forum.kirupa.com/t/changing-instance-name/239402>\
**Category:** flash\
**Created:** [September 21, 2007, 11:08am UTC](https://forum.kirupa.com/t/changing-instance-name/239402 "2007-09-21T11:08:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![perfecthill](https://avatars.discourse-cdn.com/v4/letter/p/c77e96/32.png) [@perfecthill](https://forum.kirupa.com/u/perfecthill)\
**Post date:** [September 21, 2007, 11:08am UTC](https://forum.kirupa.com/t/changing-instance-name/239402/1 "2007-09-21T11:08:27Z")

</div>

Hello!

I’m using a sharedObject to save an array of names. I can save the names and trace them out fine, but now I want to put the list of names from the array in to seperate text boxes. In AS2 I would have done this:

```auto
for (var i:int = 0; i < Names.data.playerNames.length; i++){
    var txtListName = "txtListName" + i;
    txtListName.text = Names.data.playerNames*;
    }

```

So the instance name of the text box is dynamically changed to txtListName0, txtListName1, txtListName2 etc, which corresponds to the already named boxes.  
But this throughs the error: ’ Cannot create property text on String’

I’m stuck, can’t seem to figure out how to do it, and help would be greatly appreciated.
