Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash MX 2004 List box troubles

Status
Not open for further replies.

martinb7

Programmer
Jan 5, 2003
235
GB
Hi, i am trying to get the data of the listbox dynamically from a database, i have the code that does that, but i want it so when you click an item in the listbox it does something.
Code:
//Create LoadVars object and load file
myData = new LoadVars();
//myData.load("anastasio.asp") //asp line
myData.load("[URL unfurl="true"]http://localhost/search.php");[/URL]
//php line
myData.ref = this;
//Fetch data 
myData.onLoad = function(succes) {
	if (succes) {
		for (var i = 0; i<this.cant; i++) {
		this.ref["Title_txt"+i].htmlText = "<b>"+this["Title"+i]+"</b>";
			_root.results.addItem(this["Title"+i]);
					}
	} else {
		trace("Error loading data");
	}
};
stop();

any ideas on how to make it do something?

i have this so far for the code on the listbox
Code:
on (change){
	trace(this.selectedItem);
}

all it comes up with is [Object Object]

any ideas??


Martin

Computing help and info:

 
what im looking for is how to add the data labels to the listbox, i can add the normal label with the addItem() code but how would you add the data part of the listbox?



Martin

Computing help and info:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top