# Dynamic textfield in button not displaying

**URL:** <https://forum.kirupa.com/t/dynamic-textfield-in-button-not-displaying/280917>\
**Category:** programming\
**Created:** [February 2, 2009, 11:35pm UTC](https://forum.kirupa.com/t/dynamic-textfield-in-button-not-displaying/280917 "2009-02-02T23:35:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Barbarossa](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@John\_Barbarossa](https://forum.kirupa.com/u/John_Barbarossa)\
**Post date:** [February 2, 2009, 11:35pm UTC](https://forum.kirupa.com/t/dynamic-textfield-in-button-not-displaying/280917/1 "2009-02-02T23:35:21Z")

</div>

Hello  
I have a dynamic textfield, which is supposed to sit inside a button and call a variable from an array, but for some reason, it doesn’t want to work.

I’ve attached it, but I’ll put the code here too, as it’s quite short.

```php

var rockets:Array = new Array();

    /* 
    rockets[] is a multi-dimesional array which holds the built rockets in the player's inventory. 
    It's elements are 
    [0] name of the equipment for display purposes
    [1] name of the equipment for code purposes
    [2] the reliability of the equipment in %
    [3] whether or not the equipment is selectable by the player in the current mission plan - set in mission.as (true or false)
    [4] whether the player has the item in their inventory, either by building it, or at the start of the game (true or false)
    */
    
    rockets = [
                ["V2 rocket #1", "V2-1", 67, false, true], 
                ["V2 rocket #2", "V2-2", 54, false, true] 
                ];

```

Then, on a dynamic text field inside the button I point the Var: window to [COLOR=Blue]\_root.rockets[0][2][/COLOR] (I also tried just plain old [COLOR=Blue]rockets[0][2][/COLOR], but that didn’t work either). Basically, I want it to take on the value of the [2] element of the array, and display it in a textfield within the button.

If you have a moment, do you think you could take a look for me, and steer me in the right direction.

Many thanks
