# Renaming a dynamic text field?

**URL:** https://forum.kirupa.com/t/renaming-a-dynamic-text-field/64911
**Category:** flash
**Created:** [September 21, 2004, 9:17am UTC](https://forum.kirupa.com/t/renaming-a-dynamic-text-field/64911 "2004-09-21T09:17:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Hommer](https://avatars.discourse-cdn.com/v4/letter/h/a3d4f5/32.png) [@Hommer](https://forum.kirupa.com/u/Hommer)
#### Post date: [September 21, 2004, 9:17am UTC](https://forum.kirupa.com/t/renaming-a-dynamic-text-field/64911/1 "2004-09-21T09:17:23Z")

</div>

How do I change the instance name of a dynamic text field (via action script that is)?!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 21, 2004, 1:13pm UTC](https://forum.kirupa.com/t/renaming-a-dynamic-text-field/64911/2 "2004-09-21T13:13:24Z")

</div>

> [@Hommer](#):
>
> How do I change the instance name of a dynamic text field (via action script that is)?!

textfield instance name myText  
myText.\_name = “myothertext”;

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 21, 2004, 1:58pm UTC](https://forum.kirupa.com/t/renaming-a-dynamic-text-field/64911/3 "2004-09-21T13:58:13Z")

</div>

> [@stringy](#):
>
> textfield instance name myText  
> myText.\_name = “myothertext”;

Cool, thanx.  
I presume i can also rename movie clips that way?!

* * *

But what if the text field does not have a name?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 21, 2004, 2:11pm UTC](https://forum.kirupa.com/t/renaming-a-dynamic-text-field/64911/4 "2004-09-21T14:11:53Z")

</div>

I guess I would ask why you would want to change the name of a dynamic text field?

And if your text field doesn’t have a name how are you going to reference it to rename it?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [September 21, 2004, 2:34pm UTC](https://forum.kirupa.com/t/renaming-a-dynamic-text-field/64911/5 "2004-09-21T14:34:17Z")

</div>

> [@Hommer](#):
>
> Cool, thanx.  
> I presume i can also rename movie clips that way?!
> 
> * * *
> 
> But what if the text field does not have a name?

Its a good question from Green L and a little unusual to rename textfields.  
Yes you can do it with mcs

To name something without an instance name do something like this  
for (var obj in this) {  
if (this[obj] instanceof Textfield) {  
this[obj].\_name = “myText”;  
}  
}

if you have several textfields, maybe you could pick some property by which to differentiate.  
eg/in the loop above  
this[obj].\_name = “myText”+Math.round(this[obj].\_x);
