# XML Playlist

**URL:** <https://forum.kirupa.com/t/xml-playlist/206053>\
**Category:** flash\
**Created:** [November 4, 2006, 5:39pm UTC](https://forum.kirupa.com/t/xml-playlist/206053 "2006-11-04T17:39:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackhart](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@blackhart](https://forum.kirupa.com/u/blackhart)\
**Post date:** [November 4, 2006, 5:39pm UTC](https://forum.kirupa.com/t/xml-playlist/206053/1 "2006-11-04T17:39:04Z")

</div>

Hi,  
I have a mp3 player… without a clickable playlist. I’m having issues making the clickable playlist. Its XML powered so i have to create the playlist on load. right now im trying to create a for loop that would attach a movie clip for each song but it isn’t working very well.  
any help would be apreciated.

```auto
playlist.onLoad = function(success) {
    if (success) {
        _global.songfile = [];
        _global.songname = [];
        _global.songband = [];
        _global.songalbum = [];
        _global.total = playlist.firstChild.childNodes.length;
        for (var i = 0; i<_global.total; i++) {
            _global.songfile* = playlist.firstChild.childNodes*.attributes.file;
            _global.songname* = playlist.firstChild.childNodes*.attributes.name;
            _global.songband* = playlist.firstChild.childNodes*.attributes.band;
            _global.songalbum* = playlist.firstChild.childNodes*.attributes.album;
            //trace(songname*+" "+songfile*+" "+songband*);
        }
        for (var q = 0; q<_global.total; q++) {
            item = attachMovie('PlaylistItem', 'PlaylistItem'+q, 1);
            playlistitem_txt = _global.songband[q]-_global.songname[q];
            item._x = 0;
            item._y = ypos;
            ypos += 20;
        }
    }
    _root.createEmptyMovieClip("sound_mc", 1);
    _global.song_nr = random(songfile.length);
    _root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr], songalbum[song_nr]);
};

```
