Okay guys, here's what I'm doing. In part one I'm parsing the XML data and the pushing all of the text data into arrays, dynamically.

Using a "for" loop I'm using the attachMovie to generate and place buttons on the stage using the array.length property. So, basically what I want to do is to be able to click on one of the buttons(movieclip) and have it display in a text field. For some reason it's not displaying the text properly. If I write the following...



genreName_txt.text = genre_array[id];

it will not display the text in the text field and it will return "undefinded" when running a trace. But if I write

genreName_txt.text = genre_array[3];

for example, it displays the proper text in the text field.

Why can't I use the "genre_array[id]" to access text within the genre_array?



genreXML = new XML();
genre_array = new Array();
ginfo_array = new Array();
genreXML.ignoreWhite = true;
genreXML.load("Genrelist.xml");
genreXML.onLoad = function(success) {
if (success) {
var rootNode = this.firstChild;
var children = rootNode.childNodes;
for (i=0; children[i]; i++) {
var Genre = children[i].attributes.genre;
var List = children[i].firstChild.nodeValue;
//trace ("Genre : "+Genre);
genre_array.push(Genre);
ginfo_array.push(List);
}
buildIt();
}
};


//-------Build Genre Buttons----------
function Buildit() {
for (i=1; i<=genre_array.length; i++) {
attachMovie("daButton_mc", "genre_mc"+i, i);
this["genre_mc"+i]._x = 95+(i-1)*10;
this["genre_mc"+i]._y = 498;
this["genre_mc"+i]._xscale = 60;
this["genre_mc"+i]._yscale = 90;
this["genre_mc"+i].id = i;
this["genre_mc"+i].onRollover = function() {
rollOver(this);
genreName_txt.text = genre_array[i];
};
this["genre_mc"+i].onRollOut = function() {
rollOut(this);
genreName_txt.text = "";
};
}
}