Loading XML into flash, 2 create dynamic MC's with thumb image

hi peeps,

I need a little help, I have been working out of the Phillip Kerman book, and am stuck with trying to get flash to attach MC’s dynamically to XML.

Firstly I have the XML loading into flash and writing the details back to output through a function.

my XML so far


<?xml version="1.0"?>
<COMMERCIAL_ROSTER> 
 <DJ>
 <NAME>Callum</NAME>
 <THUMB>image1.jpg</THUMB>
 <VENUES>Sports Cafe, Walkabout Inns, Cardiff Uni, Extreme Beach Party, Please Sir UK Tours</VENUES>
 <PROFILE>A fantastic party jock, with big impact DJ skills, a confident vocal presenter and host. Not only a DJ, but also a Host / Compere, ideal for club 18-30 style events or to work with Bands & Acts. His skills have earned him a Training Job within The Selected. An ex-Galaxy Radio Presenter.</PROFILE>
 </DJ>
 
 <DJ>
 <NAME>Stuart McDonough</NAME>
 <THUMB>image2.jpg</THUMB>
 <VENUES>Come Play, Cardiff Uni, Yates (Swindon), Breeze (Newport, Magaluf season)</VENUES>
 <PROFILE>Good all rounder who can read a crowd well, and play a multitude of different styles. Cocky, confident, and great at audience interaction. Really enjoys his work and entertaining the crowd and can always be seen bouncing around the Dj box like a mad man. Can play absolutely anything if asked always up for a challenge!</PROFILE>
 </DJ>
</COMMERCIAL_ROSTER>

I don’t how to attach a MC for every DJ in the XML, and in turn produce a text item for the XML name, venue, and a MC for the thumbnail image. I envisage a list of DJ’s one underneath the next with a gap between them all placed inside a pixel font scroller i already have set up and working. Profile is for when one of the MC’s is clicked on, another clip appears underneath the scroller with this info in, so i guess dynamic to whichever DJ is being clicked.

I’m not asking for someone to do this for me, but could certainly do with some kind of help on how to perhaps.

here is my actoinscript so far:


my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = parse;
my_xml.load("data.xml");
function parse(success) {
 if (!success) {
  trace("problem");
  return;
 }
 Commercial_Roster = new Array();
 var songs = this.childNodes[0].childNodes;
 for (var s = 0; s<djs.length; s++) {
  var thisData = new Object();
 
  for (var t = 0; t<djs[s].childNodes.length; t++) {
   thisData[djs[s].childNodes[t].nodeName] = djs[s].childNodes[t].firstChild.nodeValue;
  }
  Commercial_Roster[s] = thisData;
 }
 doString();
}
function doString() {
 var djs = my_xml.childNodes[0].childNodes;
 var theString = "My "+my_xml.childNodes[0].nodeName+" has "+djs.length+" "+my_xml.childNodes[0].firstChild.nodeName+"s \r __________"+"\r";
 for (var s = 0; s<djs.length; s++) {
  theString += "#"+s+" "+my_xml.childNodes[0].firstChild.nodeName+"===="+"\r";
  for (var t = 0; t<djs[s].childNodes.length; t++) {
   theString += djs[s].childNodes[t].nodeName+" = "+djs[s].childNodes[t].firstChild.nodeValue+"\r";
  }
 }
 trace(theString);
}

ANY HELP WOULD BE MUCH APPRECIATED THAAAAAAAAAAAANK YOU :slight_smile: