2009-09-01 92 views
0

在我的TileList中,我想选择翻转时的TileList项目,而不是点击事件。我已经将TileList设置为allowMultipleSelection =“true”。TileList项目选择

回答

2

以下是我最后做它: 我创建了一个数组,我不断更新的项目指标为我翻转TileList中的项目。 然后我简单地称之为: tilelist.selectedIndices = myArr; 当然,我添加了allowMultipleSelection =“true”属性到tileList。 适合我需要的东西。

1

我认为要做到这一点你需要扩展ListBase类 - http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/ListBase.html

ListBase是保存所有事件的问题(为itemRollOver,itemClick在等),其中的TileList扩展的类。

它看起来像该类有一个“mouseEventToItemRenderer”方法,它也需要一个ItemListRenderer类,所以你可能只需创建一个实现了IItemListRenderer的类来捕获itemRollOver鼠标事件并选择该项目。

=瑞恩 [email protected]

0

原始方法可能是从侧翻的目标分派一个新的MouseEvent.CLICK事件。

例如,

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