Flashvars and XML driven banner

Could anyone help with a simple XML driven banner I’m trying to create…

The swf looks for a variable called ‘headerImages’ passed through flashvars. Databased jpgs are then loaded according to ‘headerImages’ extension (which indicates which section of the site the user is in).

i.e. sub_banner.swf?headerImages=conferences

I need to set ‘headerImages’ from flashvars, load the image paths from XML into an empty MC and then loop these according to however many are generated in the XML.

This is what I have so far…things just are going well so far though!

Any help much appreciated…thoughts?

stop();

//Variable set
headerImages = _level0.headerImages;
//Image path
var imagePath:Array = new Array();
//Image Pause
var bannerTime:Array = new Array();

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
imagePath = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
imagePath* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
}
} else {
content = “Files cannot be loaded.”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“flash/banners.xml.php?headerImages=”+headerImages);
xmlData.onLoad = function(success) {
if (success) {
trace(“XML LOADED”);
}
play();
};

//Load banner image
var imageLoader:MovieClipLoader = new MovieClipLoader();
imageLoader.loadClip(imagePath,bannerContainer_mc);
var loadingListener:Object = new Object();
loadingListener.onLoadComplete = function() {
play();
};

imageLoader.addListener(loadingListener);

//stop for the amount of seconds defined in the XML, then move on :slight_smile:
var moveOn:Function=function(){
if(_root.pauseStatus != true) {
play();
clearInterval(intervalMoveOn);
}
}
intervalMoveOn=setInterval(moveOn,bannerTime);