Hello,

Ive got the XMl data loading to the swf. Im trying to script a swf so it is possible to click through the xml data, and have it load an external swf, using the xml data to specify the filepath.


Ive got the XMl data loading to the swf, but am having some trouble moving through the content (using a function that occurs when a button is pressed). Any info is appreciated! Thanks

the source files at at:
www.mikehalak.com/DDG_xml_portfolio.fla
www.mikehalak.com/portfolio_list_category.xml


the actionscript for the XML looks like:

//define 'output container' variable as having no value (yet...)
output="";
//start XML object
testXML = new XML();
testXML.ignoreWhite = true;
testXML.load ("portfolio_list_category.xml");
testXML.onLoad = startSlideShow;
function startSlideShow(success)
{
if (success == true)
{
//output += "Root Element: "+this.firstChild.nodeName;
//output += "\n";
//output += "This is the XML document:\n";
//output += this.toString();

//////// from ddg portfolio .fla
rootNode = testXML.firstChild; // this is the 'DDGportfolio' from XML...same as output_XMLroot =this.firstChild.nodeName;
totalCategories = rootNode.childNodes.length;
firstCategory = rootNode.firstChild.attributes.name;
currentCategory = firstCategory;
currentcategoryIndex = 1;
updateCategory(firstCategory);
categoryPortfolioitems = rootNode.firstChild.childNodes.length;// counts portfolio items total within category
firstSlideNode = rootNode.firstChild.firstChild.firstChild.attribut es.jpegURL;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);

// the varibles below pull xml content to dynamic text fields
output_XMLroot =this.firstChild.nodeName;
output_XMLcategory =this.firstChild.firstChild.attributes.name;
output_XMLportfolioitem =this.firstChild.firstChild.firstChild.attributes. name;
output_XMLfilepath =this.firstChild.firstChild.firstChild.firstChild. attributes.jpegURL;
output_XMLdescription =this.firstChild.firstChild.firstChild.firstChild. nextSibling.attributes.txt;
} else {
output += "Loading Error!";
}
}
//
function updateSlide(newSlideNode)
{
imagePath = rootNode.firstChild.firstChild.firstChild.attribut es.jpegURL;
slideText = rootNode.firstChild.firstChild.firstChild.nextSibl ing.attributes.txt;
loadMovie(imagePath, previewClip);
loadMovie(imagePath, targetClip);
} // End of the function



// control for Next category button
next_category_btn.onRelease = function ()
{
imagePath = rootNode.firstChild.firstChild.nextSibling.firstCh ild.attributes.jpegURL;
slideText = rootNode.firstChild.firstChild.nextSibling.firstCh ild.nextSibling.attributes.txt;
nextSlideNode = currentSlideNode.nextSibling.firstChild.attributes .name;
if (nextSlideNode == null)
{
}
else
{
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}

// control for previous category button
back_category_btn.onRelease = function ()
{
imagePath = rootNode.firstChild.firstChild.previousSibling.fir stChild.attributes.jpegURL;
slideText = rootNode.firstChild.firstChild.previousSibling.fir stChild.previousSibling.attributes.txt;
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null)
{
}
else
{
currentIndex--;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
}


// control for Next button
next_btn.onRelease = function ()
{
imagePath = rootNode.firstChild.firstChild.firstChild.nextSibl ing;
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null)
{
}
else
{
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}

// control for back button
back_btn.onRelease = function ()
{
imagePath = rootNode.firstChild.firstChild.firstChild.previous Sibling;
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null)
{
}
else
{
currentIndex--;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
}