After hurdling my initial xml problem, I have encountered another I just can’t wrap my head around for the life of me. I will explain what I’m trying to do as clearly as possible… It confuses me to think about it though so it may not make sense xD
Anywho, the part I am stuck with is this: I am trying to using a XML document to create a movieclip with a name taken from the file, load an external swf into it, using a path in the xml, and then position it. I will have multiple movieclips (just 2 for testing purposes though) so I am using a forloop to attempt to create/assign the proper values. But alas it’s not working.
Here is what I have so far…
AS
function startXML(success){
if (success == true){
rootNode = container_xml.firstChild;
xmlLength = rootNode.childNodes;
for(i=0;i<xmlLength.length; i++){
currentNode = xmlLength*;
if(parseInt(currentNode.attributes.num) == pageID){
xmlLength = currentNode.childNodes;
for(i=0;i<xmlLength.length; i++){
currentNode = xmlLength*;
firstKid = currentNode.firstChild;
secondKid = firstKid.nextSibling;
thirdKid = secondKid.nextSibling;
fourthKid = thirdKid.nextSibling;
if(counter == 0){ //**<----------Problem is in this if I think**
container = thirdKid.firstChild;
swfName = fourthKid.firstChild;
this.createEmptyMovieClip('"'+container+'"', this.getNextHighestDepth());
container.loadMovie('"'+swfName+'"');
heightOffSet = parseInt(firstKid.firstChild);
centerOffSet = parseInt(secondKid.firstChild);
counter+=1;
}
}
}
}
}
}
XML
<root>
<page num="1">
<container count = "0">
<h>10</h>
<o>0</o>
<n>container</n>
<l>test_box.swf</l>
</container>
<container count = "1">
<h>100</h>
<o>75</o>
<n>container</n>
<l>test_box.swf</l>
</container>
</page>
<page num="2">
<container>
<h>10</h>
<o>0</o>
</container>
</page>
</root>
I have also attached my latest working files. If you look at them I am doing a few other things, but the problem is in the XML section.
Any help would be much appreciated.