我从c#web服务获取对象但是我不能在xml列表中使用它们,请你看看我的代码。
function LoadedXML(evt:ResultEvent):void {
clearALL();
loading.alpha = 0;
//trace(evt.target.data);
xmlData = new XML(evt.result);
trace(xmlData+"\n objects are listed successfully");
var allDATAS:XMLList = xmlData.catNameServiceLibrary.attributes();
// there should be problem here when accessing nodes
for each (var datas:XML in allDATAS)
{
if (datas.name() == "CatName")
{
var tmpText:String = datas.toString();
catName_XML.push(tmpText.substr(0,1).toLocaleUpperCase()+tmpText.substr(1,20).toLocaleLowerCase());
}
if (datas.name() == "Popular")
{
popular_XML.push(datas.toString());
}
if (datas.name() == "Gender")
{
gender_XML.push(datas.toString());
}
}
当我跟踪跟踪时(xmlData +“\ n对象列出成功”);
我得到了输出
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
如何将数据存储到xmllist中...