I need to be able to select an index and have it visible. I can get the index to be selected but can’t get it to scroll…
for (var _index:int=0; _index < registrarsAll.length; _index++) {
registrarsList.addItemAt(registrarsAll[_index].name, registrarsList.length);
registrarsIDs.addItemAt(registrarsAll[_index].id, registrarsIDs.length)
if(registrarsAll[_index].id == judgeID) {
judgesLB.selectedIndex = registrarsIDs.length-1;
}
}
judgesLB.scrollToIndex(judgesLB.selectedIndex);
The index gets selected but I can’t get it to scroll into view. I am calling this on creationComplete. registrarsList is the data source for the list judgesLB.
thanks for any help.
John
I was able to get it to work in the updateComplete event of the judgesLB list…
selectedIndex cannot be negative. -1 will generate an error.