Here's one way.   If you're scrolling to the index and setting the
currentItem, you an use this code with the change event:

private function onItemClick(event:ListEvent):void
{
         var pt:Point = new Point(event.itemRenderer.x,
event.itemRenderer.y);
         pt = event.currentTarget.localToGlobal(pt);
         Alert.show(pt.y.toString());
}

<mx:List itemClick="onItemClick(event)">
-TH

--- In [email protected], "blc187" <[EMAIL PROTECTED]> wrote:
>
> Is there a way to get the y position of a row in a list or datagrid?
>
> I noticed that list has a protected var rowInfo that holds an array of
> ListRowInfo objects with x and y properties.
> From the list class I could do rowInfo[rowNumber].y but am trying to
> get the y value from outside the list though...
>
> Also, rowInfo only holds info for the visible rows.
> For example, I have a list with 65 items, 20 of which are shown before
> the scrollbar shows up.
>
> I want to get rowInfo[5], fine.
> I want to get rowInfo[25] it throws an error.
>
> So I need to scrollToIndex(25) but then I don't know which entry in
> rowInfo corresponds to my selected item.
>

Reply via email to