check if the below post helps. They used verticalScrollPosition attribute to determine the visble items in a datagrid. Can try applying this to your List/SkinnableDataContainer?
Thanks for the assistance. That might be useful, but it's not really what I was trying to achieve. Here's some additional details about what I am trying to do:
The user can click on one of the thumbnails(itemrenderer) which changes the background color and launches a larger version of the image. Within that larger image is a next and previous button which when clicked will load the next/prev image. I need to be able to change the background color of the next/previous itemrenderer when one of the buttons is clicked. So, in essence, I need to determine the next/previous itemrenderer and call the function that will change the background color. The function that changes the background color is in the itemrenderer, thus I need to know which one to call. Hope this helps clear things up.
I think I would simply use selectedItem/selectedIndex to indciate which
image is shown, then use the selectedState in the renderer to show the
I assume you are referring to the selectedIndex from the dataProvider? So, if for example, I click on the 5th thumbnail, the selectedIndex would be 4! How would I use this information to access the next or previous itemrenderer once the 'Next' or 'Previous' button is clicked? I obviously know that the selectedIndex would either be 5 or 3 respectively, but I am confused as to how use this information to access the new respective itemrenderer.
The dataProvider doesn't have a selectedIndex, the List class does,
referencing the index of an item in the dataProvider. The renderers are
views of the dataprovider items.
Let's say someon clicks on the 5th renderer. That will set the List's
selectedIndex to 4 and the renderer will be set to the "selected" state. In
the selected state, you would draw a different background color. Somewhere
else, other code uses the selectedIndex to pick the image from the
dataProvider and display it with next and prev buttons. The next and prev
buttons simply increment or decrement the List's selectedIndex.
I am not using a list, but rather a SkinnableDataContainer. Looking at the Flex Docs, it doesn't appear that it extends List, but is rather a super class to List/ListBase. Therefore I am not sure how I am supposed to get the selectedIndex.
Am I missing something or not understanding your reply? Thanks.
Maybe I'm missing something. Why not use List?
Thanks. That will work! Not sure why SkinnableDataContainer was initially used.