# Dynamic Text field inside Button

**URL:** <https://forum.kirupa.com/t/dynamic-text-field-inside-button/280162>\
**Category:** flash\
**Created:** [January 23, 2009, 4:16pm UTC](https://forum.kirupa.com/t/dynamic-text-field-inside-button/280162 "2009-01-23T16:16:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stooee](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@stooee](https://forum.kirupa.com/u/stooee)\
**Post date:** [January 23, 2009, 4:16pm UTC](https://forum.kirupa.com/t/dynamic-text-field-inside-button/280162/1 "2009-01-23T16:16:24Z")

</div>

Hey guys,

I could have sworn I did this before but now I can’t seem to get it to work.

I am loading some text from an xml file and I can get it to display within a dynamic text field. I need to create just a simple link that when you rollover it the text color changes.

I have tried to put the dynamic text field inside the but and set the up and down stated but i lose the text being loaded in dynamically. Here is what I am doing in a nutshell.

load my text from xml  
I have a dynamic text field named d\_Txt (if I leave this outside the button it works fine)  
I have put the text field into a button named my\_btn

then on the up state I have the d\_txt with a specific color and then in the over state i have placed the d\_txt field with a different color.

In theory I thought this should work, but it doesn’t. I have also tried place the dynamic text field inside a movie clip and then adding onRollOver and onRollOut to the movie clip to change the text but that doesn’t seem to work either.

Can anyone help me out? Thanks!
