# Buttons with Dynamic Text Labels

**URL:** <https://forum.kirupa.com/t/buttons-with-dynamic-text-labels/117577>\
**Category:** Uncategorized\
**Created:** [July 28, 2004, 3:49pm UTC](https://forum.kirupa.com/t/buttons-with-dynamic-text-labels/117577 "2004-07-28T15:49:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![drumnbassXX](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@drumnbassXX](https://forum.kirupa.com/u/drumnbassXX)\
**Post date:** [July 28, 2004, 3:49pm UTC](https://forum.kirupa.com/t/buttons-with-dynamic-text-labels/117577/1 "2004-07-28T15:49:48Z")

</div>

I think its fairly self explanitory, but Im looking for a tutorial or a simple script to reuse a movieclip, with a dynamic text field inside. I have the script to place all of the clips but I can’t get the labels to be places. I have the actionscript on the timeline frame one. Would it look something like this:

navButton1.nav\_text= “home”;

Am I way off…

---

<div class="post-metadata">

**Author:** ![newhopekenny](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/newhopekenny/32/317_2.png) [@newhopekenny](https://forum.kirupa.com/u/newhopekenny)\
**Post date:** [July 28, 2004, 4:18pm UTC](https://forum.kirupa.com/t/buttons-with-dynamic-text-labels/117577/2 "2004-07-28T16:18:20Z")

</div>

You’re almost dead-on.

Just copy/paste each MC instance that contains a dynamic text field we’ll call “myText”. Give each button instance on the stage a name, we’ll go with “button1MC” and “button2MC” for this example.

Then, on the first frame your buttons appear add:

```auto
button1MC.onLoad = function() {
this.myText.text = "Button Text";
}

button2MC.onLoad = function() {
this.myText.text = "More Button Text";
}

```

Just change instance names and text to suit your needs – I think you get the idea. 😉
