I have some images I would like to display in TileList in Flex. My TileList dimensions are 2 columns by n rows. What I want to do is to display the first item (row 1, column 1) empty and not clickable, and to start displaying my items from row 1, column 2. Is that possible?
I also wonder when I create click event for the same TileList, is there a way get an index of clicked element?
Thank you very much!
m.
Good question. I'm sure someone'll offer up a more elegant solution, but a simple approach might simply be to add a null to your dataProvider at position 0, and having your itemRenderer handle the null by displaying some sort of alternate content, or nothing at all.
To extract the index of the clicked element, there are several properties on the ListEvent objects you might use -- event.currentTarget.selectedIndex (or event.currentTarget.selectedIndices, if you're using multi-selection), event.columnIndex and .rowIndex, or event.itemRenderer, which you can use in combination with the TileList's itemRendererToIndex property, among others.
Here's a quick-and-dirty app code demonstrating both of these approaches:
Hope it helps! Post back with questions if you have 'em.