# Dynamic Text - Dynamic Variable

**URL:** <https://forum.kirupa.com/t/dynamic-text-dynamic-variable/299555>\
**Category:** flash\
**Created:** [November 6, 2009, 5:34pm UTC](https://forum.kirupa.com/t/dynamic-text-dynamic-variable/299555 "2009-11-06T17:34:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Osteel](https://avatars.discourse-cdn.com/v4/letter/o/cab0a1/32.png) [@Osteel](https://forum.kirupa.com/u/Osteel)\
**Post date:** [November 6, 2009, 5:34pm UTC](https://forum.kirupa.com/t/dynamic-text-dynamic-variable/299555/1 "2009-11-06T17:34:09Z")

</div>

Hi everyone,

Here’s a problem that’s been bugging me for quite some time and I can’t seem to get it to work! Let me explain the setup of whats happening (very simple).

There’s a movieclip, lets call it _myMovieClip_. Inside this movieclip there is a dynamic text box, lets call this one _myText_. Now to change the text within this text box that is embedded in a movieclip, it’s simply:

```auto

 _root.myMovieClip.myText.text = "Hello!";

```

However, what if there is a variable, called _myVariable_ that stores the instance name of the text box. With only one text box I know it’s pointless, but for the sake of example, lets leave it simple.

So, suddenly the code looks like:

```auto

myVariable = "myText"

_root.myMovieClip.myVariable.text = "Hello!";

```

Of course that doesn’t work. I’ve also tried:

```auto

_root[myMovieClip.myVariable].text = "Hello!";

```

Amongst other variations.

Is there any way to display this dynamic text when the instance name of the text box to do the displaying is dynamically stored within a variable?

HELP! :big-mouth:
