Populating sliding content with XML

Hi,

I’m trying to create a swf that has dynamically loaded sliding content. I have the basic sliding working, 4 buttons and each one slides the content area along to the appropriate spot.

I also have the dynamic content working in another basic swf file. Loading data from an XML file.

However, I can’t get the load script to work inside the swf I’m developing with the sliding content and I think it’s a question of putting the script in the right place.

The sliding swf has a layer with 4 buttons and a movie clip that is a window mask for the sliding content. So, within that movie clip is a movie clip comrising of the 4 panels that slide across. On each of the panels I have a dynamic text field and a movie clip (to load in a picture).

Do I need my load XML data script inside the last Movie Clip that holds the actual panels or can it go right on the top level in an actions layer?

This is the XML Load script.

var theXML:XML = new XML();
theXML.ignoreWhite = true;

theXML.onLoad = function () {
var nodes = this.firstChild.childNodes;
theText0.text = nodes[0].firstChild.nodeValue;
thePic0.loadMovie(nodes[0].attributes.pic);
theText1.text = nodes[1].firstChild.nodeValue;
thePic1.loadMovie(nodes[1].attributes.pic);
theText2.text = nodes[2].firstChild.nodeValue;
thePic2.loadMovie(nodes[2].attributes.pic);
theText3.text = nodes[3].firstChild.nodeValue;
thePic3.loadMovie(nodes[3].attributes.pic);
}

theXML.load(“contents.xml”);

Hope this makes sense, thanks

S