# Duplicate button and get the path

**URL:** <https://forum.kirupa.com/t/duplicate-button-and-get-the-path/2850>\
**Category:** Uncategorized\
**Created:** [March 26, 2002, 4:07pm UTC](https://forum.kirupa.com/t/duplicate-button-and-get-the-path/2850 "2002-03-26T16:07:01Z")\
**Posts on this page:** 6\
**Page:** 1

<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:** [March 26, 2002, 4:07pm UTC](https://forum.kirupa.com/t/duplicate-button-and-get-the-path/2850/1 "2002-03-26T16:07:01Z")

</div>

how is it possible to get pathname ja name of pressed button, that has been duplicated form parent button? My problemm is, that i can get only parent name and path, but not the duplicated one!\r\rso i first initialize:\r\rfor int i=0:i\<90;i++ (\r duplicatebutton add i to name\r)\r\r\*\*\*\*\r\rthen i have a script on each button, that tryes to read button name and with that name get’s parameters from text file:\r\ron (release) (\r loadVariables(this.buttonname, text)\r)\r\r\*\*\*\*\r\rso i can get only parent name, not the special button instance. How can i overcome this problem?

---

<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:** [March 26, 2002, 7:51pm UTC](https://forum.kirupa.com/t/duplicate-button-and-get-the-path/2850/2 "2002-03-26T19:51:52Z")

</div>

On initialize i wrote:\r\rfor (i = 0;i\<90;i++) {\r&nbsp &nbsp &nbsp &nbsp duplicateMovieClip(Button, Button add i, 1000+i);\r}\r\rand then i put those button all to the screen, but want next script on them:\r\ron (release) {\r&nbsp &nbsp &nbsp &nbsp name = this.\_name; // not he parent button name!\r&nbsp &nbsp &nbsp &nbsp \_root.loadVariables(name, text);\r}\r\rSo i want to get the name of the duplicated frame. I post this again for to make sure, that someone would understand me better.

---

<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:** [March 26, 2002, 8:01pm UTC](https://forum.kirupa.com/t/duplicate-button-and-get-the-path/2850/3 "2002-03-26T20:01:40Z")

</div>

You can’t duplicate buttons. But if button is a movie clip, you can get what you want with this[“button”+i]\r\rpom 0]

---

<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:** [March 26, 2002, 8:14pm UTC](https://forum.kirupa.com/t/duplicate-button-and-get-the-path/2850/4 "2002-03-26T20:14:30Z")

</div>

I did duplicate and all the buttons showed on stage, and worked well, but couldn’t get that name…\r\rHowever, do you mean, i should make movieclip on library on change only button type to movieclip on properties window?\r\rAlso that would mean, tha then should i do "button"actions with clipevent(mouseover)?

---

<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:** [March 26, 2002, 8:20pm UTC](https://forum.kirupa.com/t/duplicate-button-and-get-the-path/2850/5 "2002-03-26T20:20:07Z")

</div>

However, do you mean, i should make movieclip on library OR change only button type to movieclip on properties window?\r\rOR do movieclip to the libraty and made it button from properties?\r\rAnd one more question: can i write many variables to one text file? is there any separate character for that purpose?\r\r\*\*\*\*\r\rtext=There goes the text&\rtext2=But i want many variables, from one file???

---

<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:** [March 26, 2002, 8:28pm UTC](https://forum.kirupa.com/t/duplicate-button-and-get-the-path/2850/6 "2002-03-26T20:28:07Z")

</div>

Well, I’d simply select the button and F8 it to put it inside a movie clip.\r\rBut I really don’t think that duplicating a movie clip works. After all, ti’s called duplicateMOVIECLIP !! And the first argument of the method is the instance name of the clip to duplicate…\r\rpom 0]
