06-02-2011 09:45 PM
06-03-2011 04:08 AM - edited 06-03-2011 04:09 AM
just call listname.drawNow() before scrolltoindex.
its the same like in flex where you have to call validateNow()
06-03-2011 08:50 AM
Ah yes, calling drawNow() before indexToScroll() works fine too indeed ! I used it at the end, that was my error... hehe
06-09-2011 06:42 PM
This is solution for SectionList:
var firstItem:ICellRenderer = sectionListComp.firstVisibleItem;
var isHeader:Boolean = firstItem.isHeader;
var visibleSectionIndex:int = firstItem.section;
var visibleItemIndex:int = firstItem.index;
sectionListComp.dataProvider = roster;
sectionListComp.drawNow();
if (isHeader)
{
sectionListComp.scrollToIndex(visibleSectionIndex, 0);
}
else
{
sectionListComp.scrollToIndexInSection(visibleSect ionIndex, visibleItemIndex, 0);
}
07-24-2012 12:27 PM
Probably it's the best soluction I know.