Scroll to selected item in Flex 4 Spark List component

Rodion Bykov picture Rodion Bykov · Oct 21, 2009 · Viewed 24.3k times · Source

I'm setting selected element in s:List component with Actionscript, it works, but List doesn't scroll to selected item -- need to scroll with scrollbar or mouse. Is it possible to auto-scroll to selected item ? Thanks !

Answer

an0nym0usc0ward picture an0nym0usc0ward · Nov 6, 2009

Try the s:List method ensureIndexIsVisible(index:int):void.