Hey guys,
In the XML-powered portfolio I’m working on, I’d like the ability to select between multiple full-size images of a particular project. Since the number of images varies between projects, I thought it’d be best to use a 2-D array, with the first dimension holding which project it is and the second holding the pictures that pertain to that project. To illustrate:
Project 0: pic1, pic2, pic3
Project 1: pic1, pic2
Project 2: pic1, pic2, pic3, pic4
etc…
Here’s the non-functional code I have so far (I’m sorry for how far you’ll probably have to scroll):
xmlNode = this.firstChild; //points us at the first child of the XML file...
testSecondDimXML = []; //intermediate array that holds project number, and references? Not quite sure, yet...
fullSizeXML = []; //holds references to full-size pics of the thumbnails retrieved from XML file
projects = []; //holds actual movieclips
var totalProjects = xmlNode.childNodes.length;
for (i = 0; i < totalProjects; i++)
{
for(var t = 0; t < xmlNode.childNodes*.childNodes[2].childNodes.length; t++)
{
testSecondDimXML[t] = xmlNode.childNodes*.childNodes[2].childNodes[t].firstChild.nodeValue;
}
fullSizeXML** = testSecondDimXML*;
}
So have I gone about this all wrong, or what? I don’t really want to have to use any more than 2 arrays for the job of holding the multiple pictures; I’d like it as simple as possible.
Any help would be appreciated.
Thanks in advance,
TheRiddler