# Need help wit flash code for xml sheet

**URL:** <https://forum.kirupa.com/t/need-help-wit-flash-code-for-xml-sheet/223114>\
**Category:** Uncategorized\
**Created:** [April 19, 2007, 5:05pm UTC](https://forum.kirupa.com/t/need-help-wit-flash-code-for-xml-sheet/223114 "2007-04-19T17:05:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyandi\_man](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cyandi\_man](https://forum.kirupa.com/u/cyandi_man)\
**Post date:** [April 19, 2007, 5:05pm UTC](https://forum.kirupa.com/t/need-help-wit-flash-code-for-xml-sheet/223114/1 "2007-04-19T17:05:08Z")

</div>

for the following xml sheet:

\<playlist\>

\<cd thumb =“album\_music/image.gif” albumtitle=“album1” artistname=“yoohoo” tracktitles=“blah blah”\>  
\<mp3file file=“album\_music/Angel.mp3”/\>  
…other mp3 files…  
\</cd\>

…other cd nodes like above…

\</playlist\>

I have the following actionscript to navigate between each cd to play tracks within.  
i need the on release function to be corrected for me so that when u click on the icon - THE PARTICULAR cd is played which the icon represents. right now my on release function plays the first mp3 of the first cd no matter which icon u click on.

help please!

```auto
 
 
var item_spacing = 110; 
var item_count = 0; 
var tracklist = new Array();
var menu_xml = new XML(); 
menu_xml.ignoreWhite = true; 
menu_xml.onLoad = function(success){ 
if (success) {
 
var items = menu_xml.firstChild.childNodes; 
for (var i=0; i<items.length; i++) { 
var cd = items*;
var pic = items*.attributes.thumb; 
var tracks = items*.attributes.tracktitles;
var artist = items*.attributes.artistname;
var albumName = items*.attributes.albumtitle;
 
var item_mc = menu_mc.attachMovie("item_panel","item"+item_count, item_count); // linkageID, name, depth
item_mc._y = item_count * item_spacing; 
item_count++; 
 
item_mc.artistDisplay.text = "Artist: " +artist;   
item_mc.albumDisplay.text = "Album: " +albumName; 
item_mc.tracklisting.text = tracks;
item_mc.icon_border.icon_mov.loadMovie(pic);
item_mc.icon_border.icon_mov._x= 0;
item_mc.icon_border.icon_mov._y= 0;
item_mc.icon_border.onRelease = function () {
playTrack();
}
}
var theTrack = cd.childNodes; //theTrack=song    
for (var i=0; i<theTrack.length; i++) { 
var currTrack = theTrack*.attributes.file; //track=currTrack 
_root.tracklist.push(currTrack);
} 
} 
} 
menu_xml.load("mix_playlist.xml"); 
 
 
// MEDIA PLAYER CONTROLS
function playTrack(){
 _root.test_box.text= "hey";
 stopAllSounds();
 var x:Number = _global.trackNo;
 var tlength:Number = _root.currTrack.length;
 if (tlength <= x) {
  //reset ffw counter
  x = 0;
 }
 _global.trackNo = x;
 _root.track = new Sound();
 
 track.loadSound (menu_xml.firstChild.childNodes[0].childNodes[0].attributes.file, true);
 
}
 

```

please view [www.ragemultimedia.com/theheadz/mixlisttest.htm](http://www.ragemultimedia.com/theheadz/mixlisttest.htm)  
to see the webpage in question to get a better idea.
