# How to access a text within a Button programatically?

**URL:** <https://forum.kirupa.com/t/how-to-access-a-text-within-a-button-programatically/259677>\
**Category:** flash\
**Created:** [May 7, 2008, 6:33pm UTC](https://forum.kirupa.com/t/how-to-access-a-text-within-a-button-programatically/259677 "2008-05-07T18:33:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![enb141](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@enb141](https://forum.kirupa.com/u/enb141)\
**Post date:** [May 7, 2008, 6:33pm UTC](https://forum.kirupa.com/t/how-to-access-a-text-within-a-button-programatically/259677/1 "2008-05-07T18:33:05Z")

</div>

Hi i was using this for movie clips

LuzLetra is a MovieClip which contains a DynamicText inside with the name of texto

var nuevaLetra:LuzLetra = new LuzLetra();  
nuevaLetra.texto.text = “sfsf”;  
this.addChild(nuevaLetra);

this works for MovieClip but it doesn’t works if I use a Button so I would like to know if there’s a way to make it to work using Button.

---

<div class="post-metadata">

**Author:** ![enb141](https://avatars.discourse-cdn.com/v4/letter/e/82dd89/32.png) [@enb141](https://forum.kirupa.com/u/enb141)\
**Post date:** [May 9, 2008, 4:02pm UTC](https://forum.kirupa.com/t/how-to-access-a-text-within-a-button-programatically/259677/2 "2008-05-09T16:02:43Z")

</div>

Thanks for the advice.
