Attributes help needed

I’m working on a project for college and am having a spot of trouble. I’m trying to create a handy application for a football accumulator but can’t work out how to use two different attributes to display the relevant information.

The idea is to present the big four clubs, plus the team they’re playing, in the correct order - ie Home Draw Away. I’ve managed to get the first game displayed but if I change the relevant child node to display another game, I can’t get the Home Draw Away sequence or only display one of the big four games.

I’ve added two attributes to the XML - big_four=“1” or big_four=“0” - for the event and hda=“H” (ie for home) for the particpants in the game.

The XML is as follows (three games rather than all ten as an example)

<event name=“Chelsea v Hull City” date=“1st January” time=“01:00” event_name=“Premiership” big_4=“1”>
<participant name=“Chelsea” best=“2/9” best_dig=“1.22” hda=“H” />
<participant name=“Draw” best=“23/4” best_dig=“6.8” hda=“D” />
<participant name=“Hull City” best=“18/1” best_dig=“19” hda=“A” />
<event name=“Portsmouth v Fulham” January" time=“01:00” event_name=“Premiership” big_4=“0”>
<participant name=“Portsmouth” best=“11/8” best_dig=“2.38” hda=“H” />
<participant name=“Fulham” best=“11/5” best_dig=“3.2” hda=“A” />
<participant name=“Draw” best=“9/4” best_dig=“3.25” hda=“D” />
<event name=“Tottenham v Liverpool” date=“1st January” time=“01:00” event_name=“Premiership” big_4=“1”>
<participant name=“Liverpool” best=“5/4” best_dig=“2.25” hda=“A” />
<participant name=“Draw” best=“9/4” best_dig=“3.25” hda=“D” />
<participant name=“Tottenham” best=“13/5” best_dig=“3.6” hda=“H” />


The script I’m using is as follows.

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
home = [];
tie = [];
away = [];
events = xmlData.firstChild.childNodes
eventsTotal = events.length
total = xmlNode.childNodes.length;
for (i = 0; i < total; i++) {
participant_array = xmlNode.childNodes*.childNodes;
home* = “”;
tie* = “”;
away* = “”;
for (j = 0; j < participant_array.length; j++) {
participant = participant_array[0].attributes;
home* =;
participant = participant_array[2].attributes;
away* =;
participant = participant_array[1].attributes;
tie* =;
} else {
content = “file not loaded!”;
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
p = -1;
function nextImage() {
if (p < (total - 1)) {
if (loaded == filesize) {
home_txt.text = home[p];
tie_txt.text = tie[p];
away_txt.text = away[p];

Any ideas appreciated as I’m kinda stuck!:crazy: