Надеюсь, я смогу объяснить это достаточно хорошо ...
Я создал документ XML с несколькими различными типами фаз: directorsprep, checkInOut, проект, pickupPhoto, синхронизация и ежедневная.Как только мой httpService загружает xml, функция результата выглядит следующим образом:
private function processPhases(e:ResultEvent):void
{
var phases:Array = new Array("directorsprep", "checkInOut", "project", "pickupPhoto", "syncing", "daily");
var xmlList:XMLList = new XMLList;
var dupString:String = "|";
var tempArray:Array = new Array;
var tempString:String = new String;
for (var i:int = 0; i < phases.length; i++)
{
xmlList = XML(e.result).phases[i];
dupString = "|";
tempArray = new Array;
for (var j:int = 0; j < xmlList.length(); j++)
{
if (phases[i] == "directorsPrep")
tempString = "|" + xmlList[j].prepDBID + "|";
else if (phases[i] == "checkInOut")
tempString = xmlList[j].checkDBID;
else if (phases[i] == "project")
tempString = xmlList[j].dbID;
else if (phases[i] == "pickupPhoto")
tempString = xmlList[j].pickupPhotoDBID;
else if (phases[i] == "syncing")
tempString = xmlList[j].syncDBID;
else if (phases[i] == "daily")
tempString = xmlList[j].dailyDBID;
if (dupString.indexOf(tempString) == -1)
{
tempArray = new Array;
if (phases[i] == "directorsPrep")
{
tempArray[0] = xmlList[j].prepDBID;
tempArray[1] = xmlList[j].projectDBID;
tempArray[2] = xmlList[j].startDate;
tempArray[3] = xmlList[j].numdays;
tempArray[4] = xmlList[j].positions;
directorsPrepAC.addItem(tempArray);
dupString += "|" + xmlList[j].prepDBID + "|";
}
else if (phases[i] == "checkInOut")
{
tempArray[0] = xmlList[j].checkDBID;
tempArray[1] = xmlList[j].projectDBID;
tempArray[2] = xmlList[j].startdate;
tempArray[3] = xmlList[j].numdays;
tempArray[4] = xmlList[j].positions;
checkInOutAC.addItem(tempArray);
dupString += "|" + xmlList[j].checkDBID + "|";
}
else if (phases[i] == "project")
{
tempArray[0] = xmlList[j].dbID;
tempArray[1] = xmlList[j].workingTitle;
tempArray[2] = xmlList[j].projName;
tempArray[3] = xmlList[j].startDate;
tempArray[4] = xmlList[j].positions;
projectsAC.addItem(tempArray);
dupString += "|" + xmlList[j].dbID + "|";
}
else if (phases[i] == "pickupPhoto")
{
tempArray[0] = xmlList[j].pickupPhotoDBID;
tempArray[1] = xmlList[j].projectDBID;
tempArray[2] = xmlList[j].startDate;
tempArray[3] = xmlList[j].numdays;
tempArray[4] = xmlList[j].positions;
pickupPhotoAC.addItem(tempArray);
dupString += "|" + xmlList[j].pickupPhotoDBID + "|";
}
else if (phases[i] == "syncing")
{
tempArray[0] = xmlList[j].syncDBID;
tempArray[1] = xmlList[j].projectDBID;
tempArray[2] = xmlList[j].startDate;
tempArray[3] = xmlList[j].numdays;
tempArray[4] = xmlList[j].positions;
syncingAC.addItem(tempArray);
dupString += "|" + xmlList[j].syncDBID + "|";
}
else if (phases[i] == "daily")
{
tempArray[0] = xmlList[j].dailyDBID;
tempArray[1] = xmlList[j].projectDBID;
tempArray[2] = xmlList[j].startDate;
tempArray[3] = xmlList[j].numdays;
tempArray[4] = xmlList[j].positions;
dailiesAC.addItem(tempArray);
dupString += "|" + xmlList[j].dailyDBID + "|";
}
}
}
}
}
Часть, которая доставляет мне проблемы, и причина этого сообщения - строка:
xmlList = XML(e.result).phases[i];
Еслиэто не правильный способ обозначить, на какую другую фазу смотреть, может кто-нибудь сказать мне, что это?
Спасибо за ваше время, Brds