# Creating button list

**URL:** <https://forum.kirupa.com/t/creating-button-list/24291>\
**Category:** Uncategorized\
**Created:** [June 28, 2003, 1:45pm UTC](https://forum.kirupa.com/t/creating-button-list/24291 "2003-06-28T13:45:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsadan](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hsadan](https://forum.kirupa.com/u/hsadan)\
**Post date:** [June 28, 2003, 1:45pm UTC](https://forum.kirupa.com/t/creating-button-list/24291/1 "2003-06-28T13:45:59Z")

</div>

hey, i’m trying to create a list by duplicating buttons, and then when these buttons are clicked, they load a movie

so far here’s my script in a frame  
[AS]  
text1 = “link1”;  
text2 = “link2”;  
text3 = “link3”;

amount = 3;  
while (amount\>0) {  
duplicateMovieClip (\_root.button, “button”+i, i);  
setProperty (“button”+i, \_y, \_root.button.\_y+113);  
newb = “button”+i;  
\_root.newb.link.text = “text”+i;  
}  
i++;  
amount–;  
}  
[/AS]  
113 - height of a button  
link - dynamic text field inside a button

however this doesn’t work too well, the position of new buttons dont really go where they are supposed to go (which should be directly under each other). neither does the entering of the text in the new button work. :-\

anyone can help me? i think it’d be better if you’ll just scrap my script and start afresh, i’m still rather new at scripting 😛

---

<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:** [June 28, 2003, 1:49pm UTC](https://forum.kirupa.com/t/creating-button-list/24291/2 "2003-06-28T13:49:53Z")

</div>

the button clips are MCs with button events aren’t they? Because if they’re just buttons then it shouldn’t do anything.

Can you post your .fla? if you can i’ll take a shot at it.

---

<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:** [June 28, 2003, 3:11pm UTC](https://forum.kirupa.com/t/creating-button-list/24291/3 "2003-06-28T15:11:47Z")

</div>

i think when you use setProperty (“button”+i, \_y, \_root.button.\_y+113);

then the movie gets duplicated constantly on to one location. Try using,

\_root[“button”+i].\_y=\_root.button.\_y +(113\*i)

i think that should work

---

<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:** [June 29, 2003, 3:08am UTC](https://forum.kirupa.com/t/creating-button-list/24291/4 "2003-06-29T03:08:23Z")

</div>

thx kartik, that worked

however, i still can’t get the text part rite :-\  
i’ve made some changes to the script/movie clips, here’s the fla

thx for the help

---

<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:** [June 29, 2003, 6:44am UTC](https://forum.kirupa.com/t/creating-button-list/24291/5 "2003-06-29T06:44:30Z")

</div>

forgeddit guys, i fixed it 😉  
what i did wrong was i gave the textbox an instance name instead of a variable

---

<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:** [June 29, 2003, 7:29am UTC](https://forum.kirupa.com/t/creating-button-list/24291/6 "2003-06-29T07:29:40Z")

</div>

Ok…i did get it all fixed…except for 1 more problem. Now when i load it into another movie, the movieclips do not duplicate. i think that the events under the while() function are not taking place. however, still can’t find the solution:\*(

attached is the new fla
