# Creating multiple text fields

**URL:** <https://forum.kirupa.com/t/creating-multiple-text-fields/7422>\
**Category:** flash\
**Created:** [October 30, 2002, 6:10pm UTC](https://forum.kirupa.com/t/creating-multiple-text-fields/7422 "2002-10-30T18:10:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![procrasturbate](https://avatars.discourse-cdn.com/v4/letter/p/839c29/32.png) [@procrasturbate](https://forum.kirupa.com/u/procrasturbate)\
**Post date:** [October 30, 2002, 6:10pm UTC](https://forum.kirupa.com/t/creating-multiple-text-fields/7422/1 "2002-10-30T18:10:15Z")

</div>

I’m drawing a graph in flash, and I need to draw a scale.

Inside a newly created movie clip (using createEmptyMovieClip):

```auto

for(i=0; i<=sizeY; i+=yScale) {
	createTextField("mytext"+i,2,0,i,30,15);
	["mytext"+i].border = true;
	myformat = new TextFormat();
	myformat.color = 0xff0000;
	myformat.underline = true;
	["mytext"+i].text=i;
	["mytext"+i].setTextFormat(myformat);
}

```

The problem seems to lie with [“mytext”+i]… I got that convention from an example on this website, except that it was something like \_root [“mytext”+i]. But I do not wish for the text field to be in \_root… it has to be in the current movie clip.

Any ideas?

---

<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:** [October 30, 2002, 6:18pm UTC](https://forum.kirupa.com/t/creating-multiple-text-fields/7422/2 "2002-10-30T18:18:51Z")

</div>

You can specify the entite path if you have it in the current mc like

\_root.mc[“mytext”+i].text = i;

Try this! Hope this helps!

---

<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:** [October 30, 2002, 7:41pm UTC](https://forum.kirupa.com/t/creating-multiple-text-fields/7422/3 "2002-10-30T19:41:05Z")

</div>

Oh wow, didn’t think of that 🙂 Thanks!

---

<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:** [October 30, 2002, 8:05pm UTC](https://forum.kirupa.com/t/creating-multiple-text-fields/7422/4 "2002-10-30T20:05:49Z")

</div>

Usually using the absolute path helps a lot when you are working with a lot of variables. You can easily keep track of things.
