adover
04-04-2008, 09:30 AM
Sorry if this is on the wrong board! I'm wanting to load XML data into my flash animation but it just doesnt seem to be working! :( here is my code, hopefully someone can point me in the right direction!
//XML
matData_xml = new XML();
matData_xml.ignoreWhite=true;
matData_xml.load('data.xml');
matData_xml.onLoad=function(success){
if (success){
trace("loaded");
}else{
trace('flopped');
}
}
function loadXML(loaded) {
if (loaded) {
var xnRootNode:XMLNode=this;
_root.mainContent.maintitle.text = xnRootNode.firstChild.childNodes[3].childNodes[0].firstChild.nodeValue;
trace(xnRootNode.firstChild.childNodes[3].childNodes[0].firstChild.nodeValue);
}
}
as u can see, maintitle is the textfield I want to populate with the xml data, and its not working, the trace which follows does not work either!
any help appreciated :)
//XML
matData_xml = new XML();
matData_xml.ignoreWhite=true;
matData_xml.load('data.xml');
matData_xml.onLoad=function(success){
if (success){
trace("loaded");
}else{
trace('flopped');
}
}
function loadXML(loaded) {
if (loaded) {
var xnRootNode:XMLNode=this;
_root.mainContent.maintitle.text = xnRootNode.firstChild.childNodes[3].childNodes[0].firstChild.nodeValue;
trace(xnRootNode.firstChild.childNodes[3].childNodes[0].firstChild.nodeValue);
}
}
as u can see, maintitle is the textfield I want to populate with the xml data, and its not working, the trace which follows does not work either!
any help appreciated :)