Right then I have been given the task of reading an XML document into Flash using ActionScript. I have a whole 1 days experience with actionscript and not much more than that in Flash. in this time i ahve managed to get flash to download the file am now trying to loop through it.
this is what i have so far:
on (release) {
myXML = new XML();
myXML.load("arch_sites.xml"
;
myXML.ignoreWhite = true;
function myOnLoad () {
for (i=0; i<=myXML.childNodes.length; i++) {
_root.a = myXML.childNodes;
}
}
}
when i run this i either get nothing or get all of the xml document output into the textbox a.
this is the format of the xml file that is set in stone by the way:
<?xml version="1.0" encoding="UTF-8"?>
<Sites>
<Site>
<SiteName>a</SiteName>
<XCoord>3560</XCoord>
etc...
</Site>
<Site>
<SiteName>b</SiteName>
<XCoord>0653</XCoord>
etc...
</Site>
</Sites>
what i want to be able to do eventually is to loop through this xml document and only output certain elements, so loop over the whole document and grab some of the XMl elements for instance XCoord one time and then SiteName another time.
can anyone point me to a tutorial that would help me to do this, or give me a few pointers on how this would be achieved?
any help appreciated !
this is what i have so far:
on (release) {
myXML = new XML();
myXML.load("arch_sites.xml"
myXML.ignoreWhite = true;
function myOnLoad () {
for (i=0; i<=myXML.childNodes.length; i++) {
_root.a = myXML.childNodes;
}
}
}
when i run this i either get nothing or get all of the xml document output into the textbox a.
this is the format of the xml file that is set in stone by the way:
<?xml version="1.0" encoding="UTF-8"?>
<Sites>
<Site>
<SiteName>a</SiteName>
<XCoord>3560</XCoord>
etc...
</Site>
<Site>
<SiteName>b</SiteName>
<XCoord>0653</XCoord>
etc...
</Site>
</Sites>
what i want to be able to do eventually is to loop through this xml document and only output certain elements, so loop over the whole document and grab some of the XMl elements for instance XCoord one time and then SiteName another time.
can anyone point me to a tutorial that would help me to do this, or give me a few pointers on how this would be achieved?
any help appreciated !