# Dynamic Text, Data Type, Variable Problem

**URL:** https://forum.kirupa.com/t/dynamic-text-data-type-variable-problem/38424
**Category:** flash
**Created:** [December 22, 2003, 7:28pm UTC](https://forum.kirupa.com/t/dynamic-text-data-type-variable-problem/38424 "2003-12-22T19:28:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jugglerpm](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jugglerpm](https://forum.kirupa.com/u/jugglerpm)
#### Post date: [December 22, 2003, 7:28pm UTC](https://forum.kirupa.com/t/dynamic-text-data-type-variable-problem/38424/1 "2003-12-22T19:28:15Z")

</div>

I am trying to load one of 80 text fields into a dynamic text box. I have an Array that is filled with all 80 field labels in random order. My concept is that I should be able to pop the last field out of the array, set it equal to a variable, and use that variable in the statement defining the text of the text box. But it doesn’t work. It returns undefined.

Example:

[AS]nextQuestion = myList2.pop();  
myTextField\_txt.text = externalData.nextQuestion;[/AS]

The second line of the statement works if I hard code the text field name.

Example:

[AS]myTextField\_txt.text=externalData.question37;[/AS]

But it does not work if I use a variable set to question37.

I think this may have to do with the data type of the variable. It is a string. Any ideas or suggestions?

---

<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: [December 22, 2003, 8:22pm UTC](https://forum.kirupa.com/t/dynamic-text-data-type-variable-problem/38424/2 "2003-12-22T20:22:27Z")

</div>

```auto
nextQuestion = myList2.pop();
myTextField_txt.text = externalData[nextQuestion];

```

---

<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: [December 22, 2003, 8:41pm UTC](https://forum.kirupa.com/t/dynamic-text-data-type-variable-problem/38424/3 "2003-12-22T20:41:52Z")

</div>

norie,

Thank you very much! Works perfectly.

-jugglerpm
