How would I go about creating a conditional statement that checks to see if all the needed data in a particular node is defined or else move on to the next node in the iteration?
AS3 to move through the XML:
myTimer.addEventListener(TimerEvent.TIMER, timerHandler);
function timerHandler(event:TimerEvent) {
if (currentPic < xmlList.length() - 1) {
currentPic++;
trace("fire");
updatePic(currentPic);
Refresh();
} else {
currentPic = 0;
updatePic(currentPic);
Refresh();
}
}
AS3 in part for the XML paths:
function updatePic(index:int):void {
trace(currentPic);
if (Flights.flight_mc.gate_txt.text = xmlList[index].@DepartureGate = undefined) {
index ++;
} else {
Flights.flight_mc.airline_txt.text = xmlList[index].someNamespace::Airline.@Name;
Flights.flight_mc.location_txt.text = xmlList[index].someNamespace::Destination.@City;
Flights.flight_mc.gate_txt.text = xmlList[index].@DepartureGate;
Flights.flight_mc.schedTime_txt.text = xmlList[index].@DepartureDate;
Flights.flight_mc.schedTime_txt.text = newTimeStr;
Flights.flight_mc.estTime_txt.text = xmlList[index].@EstimatedGateDepartureDate;
Flights.flight_mc.estTime_txt.text = newTimeStr2;
Flights.flight_mc.status_txt.text = xmlList[index].@Status;
index ++;
}
trace(currentPic);
Flights.flight_mc2.airline_txt.text = xmlList[index].someNamespace::Airline.@Name;
Flights.flight_mc2.location_txt.text = xmlList[index].someNamespace::Destination.@City;
Flights.flight_mc2.gate_txt.text = xmlList[index].@DepartureGate;
Flights.flight_mc2.schedTime_txt.text = xmlList[index].@DepartureDate;
Flights.flight_mc2.schedTime_txt.text = newTimeStr3;
Flights.flight_mc2.estTime_txt.text = xmlList[index].@EstimatedGateDepartureDate;
Flights.flight_mc2.estTime_txt.text = newTimeStr4;
Flights.flight_mc2.status_txt.text = xmlList[index].@Status;
index ++;
trace(currentPic);
Flights.flight_mc3.airline_txt.text = xmlList[index].someNamespace::Airline.@Name;
Flights.flight_mc3.location_txt.text = xmlList[index].someNamespace::Destination.@City;
Flights.flight_mc3.gate_txt.text = xmlList[index].@DepartureGate;
Flights.flight_mc3.schedTime_txt.text = xmlList[index].@DepartureDate;
Flights.flight_mc3.schedTime_txt.text = newTimeStr5;
Flights.flight_mc3.estTime_txt.text = xmlList[index].@EstimatedGateDepartureDate;
Flights.flight_mc3.estTime_txt.text = newTimeStr6;
Flights.flight_mc3.status_txt.text = xmlList[index].@Status;
index ++;
trace(currentPic);
Would a switch case be the correct statement and if so how do I go about that in the syntax?
Thanks again for all the input and direction as it is always appreciated!