PDA

View Full Version : How to make List Component autoselect first item


fokusz
05-28-2005, 09:07 AM
I have been searching all over the net for a solution to this problem, however no luck, even on macromedia.livedocs...

I have built a listbox which loads its data from an xml file, once this data is loaded I would like to have the first item in the box autoselect, or highlight.

I would have thoguht this to be possible, but have had no success wither way...Is this possible with Flash MX2004?

Thanks in advance

tg
05-28-2005, 10:29 PM
should be something like:

myListBox.setSelectedItem(0);


or maybe setSelectedIndex(0);

fokusz
05-29-2005, 05:34 AM
THANKS tg!!! it worked I think I was over scripting before! sometimes the most difficult thing is so simple... :)

cheers

stormwild
07-07-2005, 12:16 PM
Is there a way to highlight a single cell in a DataGrid through actionscript in the same way that it was done for the List?