PM Hopper
07-17-2007, 12:17 PM
So I've got a projector file running locally that is using a hard-coded XML file that the client can update themselves. I know from the past that I'm doing this poorly however it's worked up until know?
This is the XML
<smartdata>
<splash_image>img/splash.png</splash_image>
<fade_splash>5</fade_splash>
<intro_video>video/intro.flv</intro_video>
<departments>10</departments>
<dep_data>data/dep_data</dep_data>
<department_names>
<department>Dep 1</department>
<department>Land Development</department>
<department>Human Resources</department>
<department>IT / IS</department>
<department>Land Development</department>
<department>Leasing</department>
<department>Acquisitions</department>
<department>Engineering</department>
<department>Construction</department>
<department>President</department>
</department_names>
<closing_video>video/trailer.flv</closing_video>
<closing_image>img/closing.png</closing_image>
</smartdata>
I can target all the main Children however when I get to "department_names" it only reads the first result?
This is my Actionscript.
trace(_level0.featXML.firstChild.childNodes[5].firstChild.childNodes[0].nodeValue);
trace(_level0.featXML.firstChild.childNodes[5].firstChild.childNodes[1].nodeValue);
The first result works fine however the second comes through undefined?
I've hard coded to get 15 results as I've built in enough however if I could figure this out I think a loop would work best?
Thanks
This is the XML
<smartdata>
<splash_image>img/splash.png</splash_image>
<fade_splash>5</fade_splash>
<intro_video>video/intro.flv</intro_video>
<departments>10</departments>
<dep_data>data/dep_data</dep_data>
<department_names>
<department>Dep 1</department>
<department>Land Development</department>
<department>Human Resources</department>
<department>IT / IS</department>
<department>Land Development</department>
<department>Leasing</department>
<department>Acquisitions</department>
<department>Engineering</department>
<department>Construction</department>
<department>President</department>
</department_names>
<closing_video>video/trailer.flv</closing_video>
<closing_image>img/closing.png</closing_image>
</smartdata>
I can target all the main Children however when I get to "department_names" it only reads the first result?
This is my Actionscript.
trace(_level0.featXML.firstChild.childNodes[5].firstChild.childNodes[0].nodeValue);
trace(_level0.featXML.firstChild.childNodes[5].firstChild.childNodes[1].nodeValue);
The first result works fine however the second comes through undefined?
I've hard coded to get 15 results as I've built in enough however if I could figure this out I think a loop would work best?
Thanks