# Loading the value of a variable into a dynamic text field

**URL:** <https://forum.kirupa.com/t/loading-the-value-of-a-variable-into-a-dynamic-text-field/216832>\
**Category:** flash\
**Created:** [February 20, 2007, 11:00pm UTC](https://forum.kirupa.com/t/loading-the-value-of-a-variable-into-a-dynamic-text-field/216832 "2007-02-20T23:00:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalewb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dalewb/32/3029_2.png) [@dalewb](https://forum.kirupa.com/u/dalewb)\
**Post date:** [February 20, 2007, 11:00pm UTC](https://forum.kirupa.com/t/loading-the-value-of-a-variable-into-a-dynamic-text-field/216832/1 "2007-02-20T23:00:08Z")

</div>

I have a variable that changes according to the position of a slider. I would like to display the numerical value of this variable inside a dynamic text field (created on the stage during authoring).

I tried many approaches, but the one I was sure would work didn’t. I referenced the “text” value of the dynamic text field from the frame in which the variable was instantiated and used. This did not work, so I am not sure what to do.

Here is basically what I did:

```auto

var sp:Number = null; //controls the speed of the slideTo function

// sets the value of sp based on the position of the speed slider
onEnterFrame = function(){    
    sp = this._parent.menuCntlMC.fasterMCholderMC.fasterMC._y*.037;    
}

this._parent.menuCntlMC.indicatorMC.text = sp;

```

[SIZE=1]help![/SIZE]
