# Dynamic Playlist (mp3 player)

**URL:** <https://forum.kirupa.com/t/dynamic-playlist-mp3-player/27148>\
**Category:** flash\
**Created:** [July 30, 2003, 4:30pm UTC](https://forum.kirupa.com/t/dynamic-playlist-mp3-player/27148 "2003-07-30T16:30:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KaOsX](https://avatars.discourse-cdn.com/v4/letter/k/8e7dd6/32.png) [@KaOsX](https://forum.kirupa.com/u/KaOsX)\
**Post date:** [July 30, 2003, 4:30pm UTC](https://forum.kirupa.com/t/dynamic-playlist-mp3-player/27148/1 "2003-07-30T16:30:46Z")

</div>

I’m making an MP3 player for my website and I want to be able to be able to make a txt (or xml) file that will define the playlist, the thing i’m having trouble with is doing a for each type thing (im a php guy :)) all i need is for it to add each line to a listbox or something, can you help me please?

thanks in advance, just say so if you want me to do something in return  
😃

---

<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 30, 2003, 4:35pm UTC](https://forum.kirupa.com/t/dynamic-playlist-mp3-player/27148/2 "2003-07-30T16:35:24Z")

</div>

> **[kirupa.com - Displaying Data from an External File](https://www.kirupa.com/developer/mx/externaldata.htm)**
>
> Learn how to load data from an external file and display the contents in Flash.

> just say so if you want me to do something in return

mail me a twenty 😉

---

<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 30, 2003, 4:36pm UTC](https://forum.kirupa.com/t/dynamic-playlist-mp3-player/27148/3 "2003-07-30T16:36:15Z")

</div>

that dont help but thx for the try =/

I need an example or something that shows how to count… for example in my text file…

menu=something|something2|somthin

the flash movie would make 3 buttons with those titles, and if i had 20 then make 20 with those titles, you understand? 🙂

---

<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 30, 2003, 5:02pm UTC](https://forum.kirupa.com/t/dynamic-playlist-mp3-player/27148/4 "2003-07-30T17:02:09Z")

</div>

I would use a mySql db to add each one and then count with php the number of rows. Then set a var and use a while loop to cycle through and append the var that is '++'d each time to the end of the name. or just set the table’s rowid to autoincrement and use that b/c it should go numerically 1-end.

then write to a txt file and load that file.

::edit:::  
oh, you mean from flash, I’m no AS whiz, it’d take me forever.

---

<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 30, 2003, 5:32pm UTC](https://forum.kirupa.com/t/dynamic-playlist-mp3-player/27148/5 "2003-07-30T17:32:06Z")

</div>

i made the code already 🙂

[AS]on (release) {  
current = “0”;  
data = [“one”, “two”, “three”];  
total = data.length;  
while (Number(current)\<Number(total)) {  
list.additem(data[current]);  
current = Number(current)+1;  
}  
}[/AS]
