# Difficulties with attachMovie

**URL:** <https://forum.kirupa.com/t/difficulties-with-attachmovie/156461>\
**Category:** Uncategorized\
**Created:** [July 25, 2005, 11:18pm UTC](https://forum.kirupa.com/t/difficulties-with-attachmovie/156461 "2005-07-25T23:18:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alakazam35](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/alakazam35/32/1558_2.png) [@alakazam35](https://forum.kirupa.com/u/alakazam35)\
**Post date:** [July 25, 2005, 11:18pm UTC](https://forum.kirupa.com/t/difficulties-with-attachmovie/156461/1 "2005-07-25T23:18:45Z")

</div>

So I got the idea recently to build an mp3 playing application that used a playlist loaded from an XML file. I just want it to get to where the program reads how many songs are in the XML, makes that many buttons with the song name on them, etc. so that when you click the button the song will play. I’m fairly clear on the sound and XML aspects, but I’m having trouble getting this loop to work:

var btn\_height:Number = 0;  
var button\_name = [];  
for (i=0; i\<4; i++) {  
button\_name\* = “songbtn” + i;  
\_root.attachMovie(“song\_btn”, “songbtn” + i, 10);  
btn\_height += 24;  
button\_name\*.\_y = btn\_height;  
trace(“success”);  
};

When I run this, what I get is one button at (0,0) when what I want is five buttons one on top of the other. Any advice?

also, this is my first post, so let me know if I’m missing any information here.
