greetings, I am just getting my feet wet with using XML as a datasource in
Flash so I hope this roadblock I'm hitting has a simple solution that I have
overlooked. I have taken one of the tutorials on the mm site and begun to
modify it to my needs. For the purpose of this example, I am just trying to
accomplish the following: 1. create a new XML object 2. load an external file
(slides.xml) into the newly created object 3. iterate through a set of nodes
and print out (trace) the value of that node The contents of my XML file (same
one used in tutorial) are: <Slides> <slideNode
jpegURL='images/image1.jpg'>A sea horse</slideNode> <slideNode
jpegURL='images/image2.jpg'>Sea anemone</slideNode> <slideNode
jpegURL='images/image3.jpg'>Sardines!</slideNode> <slideNode
jpegURL='images/image4.jpg'>Another sea horse</slideNode> <slideNode
jpegURL='images/image5.jpg'>Some kind of jellyfish</slideNode> </Slides> My
movie currently consists of one frame containing only actionscript: var
slideXML = new XML; slideXML.ignoreWhite = true; slideXML.load('slides.xml');
slideXML.onLoad = placeThumbs; function placeThumbs(success) { if(success) {
rootNode = slideXML.firstChild; firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode; trace(currentSlideNode.nodeValue);
currentSlideNode = currentSlideNode.nextSibling; while(currentSlideNode !=
null) { trace(currentSlideNode.nodeValue); currentSlideNode =
currentSlideNode.nextSibling; } } } When testing this movie, the output
window shows: null null null null null One 'null' for each node I am trying
to get the value of. It's weird because when I change the line:
trace(currentSlideNode.nodeValue); to
trace(currentSlideNode.attributes.jpegURL); the output shows the 5 different
values of this attributes as expected. What's even weirder is that just for the
sake of trying, I changed my actionscript to: var slideXML = new XML;
slideXML.ignoreWhite = true; slideXML.load('slides.xml'); slideXML.onLoad =
placeThumbs; function placeThumbs(success) { if(success) { rootNode =
slideXML.firstChild; firstSlideNode = rootNode.firstChild; currentSlideNode
= firstSlideNode.firstChild; trace(currentSlideNode.nodeValue);
currentSlideNode = currentSlideNode.nextSibling; while(currentSlideNode !=
null) { trace(currentSlideNode.nodeValue); currentSlideNode =
currentSlideNode.nextSibling; } } } the output window returned: A sea
horse the 1st trace statement is executed but the one within the while loop is
never reached. To me, it seems as though the 1st trace should have returned
null ... I've been through this over and again until my head was about to
explode. Can anyone see what I'm doing wrong?