views:

487

answers:

3

In my TileList, I want to select the TileList items on rollover, as opposed to the click event. I already have the TileList setup to allowMultipleSelection = "true".

+1  A: 

I think to do this you'd need to extend the ListBase class - http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html

ListBase is the class that holds all of the events in question (itemRollOver, itemClick, etc) and which TileList extends.

It looks like that class has a "mouseEventToItemRenderer" method which takes an ItemListRenderer class as well, so you can probably just create a class with implements IItemListRenderer to capture the itemRollOver mouse event and select the item.

=Ryan [email protected]

ryanstewart
A: 

A crude way might be to dispatch a new MouseEvent.CLICK event from the target of the rollover.

e.g.,

private function _handleRollOver(e:MouseEvent):void {
  e.target.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
}
Glenn
+2  A: 

Here's how I ended up doing it: I created an array to which i keep updating the item indices as I rollover tilelist items. then I simply call this: tilelist.selectedIndices = myArr; Of course, i added the allowMultipleSelection = "true" property to the tileList. Works good for what I needed.

Q-rius