It works fine, have a look at this..
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="load()">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
private function load():void {
var arr:ArrayCollection = new ArrayCollection;
for (var i:int=0; i< 20; i++) {
arr.addItem("Item " + i);
}
li.dataProvider = arr;
}
private function scrollTo(index:int) : void {
li.scrollToIndex(index);
}
]]>
</mx:Script>
<mx:List id="li" x="171" y="246" height="27" width="183" />
<mx:Label x="171" y="293" text="Enter Index number:"/>
<mx:TextInput id="index" x="290" y="291" width="64"/>
<mx:Button x="228" y="329" label="Submit"
click="scrollTo(parseInt(index.text))"/>
</mx:Application>
With Regards,
Niamath Basha
On Sat, Jul 4, 2009 at 5:06 AM, flexcoder2008 <[email protected]> wrote:
>
>
> How do you make scrollToIndex work on a List where the last item in the
> List is currently not visible?
>
> When I use List.scrollToIndex it works for any item above my current
> selection, but will never scroll to the end of the List.
>
>
>