Search Tutorials
The Fla file: Actionscript for buttons, accessing the XML fileWe now have to get access to the XML file. We do that by creating a function containing a loop. In this function we search for the root node "models".
//function to get to the root node and the childnodes
function newModel() {
//loop going through the xml file whereby childNodes.length is the number of child nodes
for (var count01=0; count01<=models.childNodes.length; count01++) {
//the root node name "models"
if (this.childNodes[count01].nodeName.toLowerCase() == "models") {
//this var holds the complete xml file
modelsDescryption = this.childNodes[count01];
}
}
//function to get access to individual childnodes
//modelsDescryption will carry over the extracted contents from the previous
//function to the next function
findModels(modelsDescryption);
}
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|