# Buttons with Dynamic Text Labels

**URL:** https://forum.kirupa.com/t/buttons-with-dynamic-text-labels/59112
**Category:** Uncategorized
**Created:** [July 28, 2004, 3:49pm UTC](https://forum.kirupa.com/t/buttons-with-dynamic-text-labels/59112 "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/59112/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: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 28, 2004, 4:18pm UTC](https://forum.kirupa.com/t/buttons-with-dynamic-text-labels/59112/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. 😉
