flash如何调用xml文件内容
哪位高手给写个实例啊,谢谢了~~
怎么没人啊···
//第二段代码START
stop();
//将data.xml文件加载
infoDefault = "";
showSrc = "";
nowBtnName = "no";
nowNum = 0;
xmlObj = new XML();
xmlObj.ignoreWhite = true;
xmlObj.load("execute.asp");
//XML文件所在地址
xmlObj.onLoad = function(success) {
if (success) {
trace("XML加载成功!");
loadData();
//分析XML文件的函数
} else {
trace("XML加载失败!");
}
};
//建立三个数组以便装载XML中的数据
var myArray = new Array();
var doc = xmlObj.firstChild.childNodes
function loadData(){
for (k=0; k<doc.childNodes.length; k++) {
myArray[i] = new Object();
myArray[i].n = doc[i].attributes.name;
myArray[i].p = doc[i].attributes.password;
trackData = doc.childNodes[j].attributes.name;
trace(trackData);
myArray.push(trackData);
//trace(myArray);
}
for(i = 0;i<myArray.length;i++){
txtAdd.text = myArray[i].p
}
}
stop();
各位大虾看看是这样显示的么??