Dynamic Text - Dynamic Variable

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:


 _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:


myVariable = "myText"

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

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


_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: