Random values issue

Hi - I’m pulling simple xml text data into my flash movie, and am trying to pick a random xml node to display each time the movie plays. The code I’m using is below…

function loadXML(loaded) {

if (loaded) {
xmlNode = this.firstChild;
titledata = [];
clientdata = [];
textdata = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
titledata* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
clientdata* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
textdata* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
}
firstItem();
} else {
content = “file not loaded!”;
}
}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“data.xml”);

p = random (i);

function firstItem() {
textclip.title_txt.text = titledata[p];
textclip.client_txt.text = clientdata[p];
textclip.text_txt.text = textdata[p];
}

So ‘i’ is the total number of nodes, and ‘p’ is the currently displayed node, strangely ‘p = random (i)’ just won’t work for me.

What am i missing?

Thx