hi, my problem is this:
I have on my stage some dynamic textboxes and a list box. The listbox is populated by an XML file of music artists names. What i would like to do is create a function so that when the artist is selected in the listbox, the dynamic textboxes display the relevant information.
The code i have so far is this:
//Declare variable to act as start of XML playlist
_global.i = 0;
//Create the XML object "Playlist"
playlist = new XML();
playlist.onLoad = loadXML;
playlist.ignoreWhite = true;
playlist.load("music.xml");
_root.createEmptyMovieClip("artwork_mc",_root.getNextHighestDepth());
artwork_mc._x = 10;
artwork_mc._y = 100;
var songlist_lb:mx.controls.List;
//Create function to check if XML is loaded, and if it is populate the listbox
//instance on the stage
function loadXML(loaded){
if(loaded){
var songArray:Array = playlist.firstChild.childNodes;
for(i=0; i<songArray.length; i++){
songlist_lb.addItem({label:songArray*.childNodes[0].firstChild.nodeValue})
}
var songlistListener:Object = new Object();
songlistListener.change = function() {
//here is where i get stuck!!
}
}
songlist_lb.addEventListener("change", songlistListener);
}
I have no clue as to how to get this to work. The names of the textboxes are as follows:
artist_display.text
era_display.text
album_display.text
track_display.text
Any help from anyone would be helpful!!
Thanx