# Addressing a textfield

**URL:** <https://forum.kirupa.com/t/addressing-a-textfield/20777>\
**Category:** flash\
**Created:** [May 13, 2003, 10:28am UTC](https://forum.kirupa.com/t/addressing-a-textfield/20777 "2003-05-13T10:28:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oscar\_alexander](https://avatars.discourse-cdn.com/v4/letter/o/e5b9ba/32.png) [@oscar\_alexander](https://forum.kirupa.com/u/oscar_alexander)\
**Post date:** [May 13, 2003, 10:28am UTC](https://forum.kirupa.com/t/addressing-a-textfield/20777/1 "2003-05-13T10:28:08Z")

</div>

I have six textfields inside a clip, named digit\_1 to digit\_6.

The path to the first textfield would be:

```auto
_root.mcContainer.digit_1;

```

How can I dynamically address these fields if I only know the number (ie. 1 to 6)? I’ve tried this:

```auto
eval("_root.mcContainer.digit_" + number) = "value";

```

But to no avail. Please help…

---

<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:** [May 13, 2003, 11:58am UTC](https://forum.kirupa.com/t/addressing-a-textfield/20777/2 "2003-05-13T11:58:54Z")

</div>

I think it is the other brackets:  
eval[“_root.mcContainer.digit_” + number] = “value”;

---

<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:** [May 13, 2003, 12:07pm UTC](https://forum.kirupa.com/t/addressing-a-textfield/20777/3 "2003-05-13T12:07:24Z")

</div>

Nope. But I found another way to get it right… Instead of using the textfield as a variable, I gave it an instancename and addressed that, like this:

```auto

eval("_root.mcContainer.digit_" + number).text = "value";

```
