I’m working on a simple image gallery that will use an xml document to load in varibales.
I read in this xml document sructure from my text file:
<?xml version="1.0" encoding="iso-8859-1"?>
<gallery>
<image>
<thumb>thumb_1.jpg</thumb>
<imageName>image_1.jpg</image>
<caption>Image 1 caption</caption>
</ image>
<image>
<thumb>thumb_2.jpg</thumb>
<imageName>image_2.jpg</image>
<caption>Image 2 caption</caption>
</ image>
<gallery>
using the following actionscript:
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.load("events/events.xml");
gallery_xml.onLoad = function(success) {
if (success) {
trace(gallery_xml.childNodes)
}
};
when i look at the trace of gallery_xml.childNodes, I get this:
<gallery><image><thumb>thumb_1.jpg</thumb><imageName>image_1.jpg</imageName></image></gallery>
My XML appears to have loaded in incorrectly- the xml object is only quoting back the first <image> tag, not its siblings. When i try to access the second <image> node my structure, it isn’t there at all.
Its probably something simple- can anyone help?