# Dynamic button label/name

**URL:** https://forum.kirupa.com/t/dynamic-button-label-name/69131
**Category:** Uncategorized
**Created:** [November 1, 2004, 8:18pm UTC](https://forum.kirupa.com/t/dynamic-button-label-name/69131 "2004-11-01T20:18:28Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![neadeau](https://avatars.discourse-cdn.com/v4/letter/n/c89c15/32.png) [@neadeau](https://forum.kirupa.com/u/neadeau)
#### Post date: [November 1, 2004, 8:18pm UTC](https://forum.kirupa.com/t/dynamic-button-label-name/69131/1 "2004-11-01T20:18:28Z")

</div>

I am trying to save some time when it comes to producing a bunch of buttons that are the same in style but are just labled differently. My idea is that I create the button inside a MC on the stage and use duplicateMovieClip to dup it as many times as I need. Then, I will access the the dynamic text field inside the button and name the button that way.

Duplication is working but naming is not. HELP PLEASE!!!  
Here is my code.  
Be kind, I am a Flash newbie:

//Function that duplicates the button  
dup = function () {  
x = 1;  
MaxButton = 5;  
while (x\<MaxButton) {  
duplicateMovieClip(button\_mc, “button”+x+"\_mc", x);  
\_root[“button”+x+"\_mc"].\_x = \_root[“button”+x+"\_mc"].\_x+100\*x;  
x++;  
}  
};  
//Calling the duplicate Function  
dup();  
//Naming the buttons and passing the name into the dynamic text field inside button(x)\_mc.  
//Text Field is titled newName. BUT IT DOESN"T WORK!!!

button0\_mc.newName = “Button 0”;  
button1\_mc.newName = “Button 1”;  
button2\_mc.newName = “Button 2”;  
button3\_mc.newName = “Button 3”;  
button4\_mc.newName = “Button 4”;  
//Checking to see if naming convention of button(x)\_mc worked. And it does  
button1\_mc.onRelease = function() {  
button1\_mc.newName = “Button 1”;  
trace(“hello”);  
};

PLease help!
