1

我在尝试使用 ActionScript 3.0 获取当前悬停在 flash 的数据网格组件上的行的索引时遇到了一些问题。

那么请问如何在 AS3 中获取鼠标悬停时数据网格的行索引。

谢谢

4

1 回答 1

1

您使用ListEvent.ITEM_ROLL_OVER事件而不是基本的鼠标悬停

import fl.events.ListEvent;

var sampleItem1:Object = { Name:"John Alpha",   Number:"555-123-0101", Email:"jalpha@fictitious.com" };
var sampleItem2:Object = { Name:"Mary Bravo",   Number:"555-372-3322", Email:"mbravo@fictitious.com" };
var sampleItem3:Object = { Name:"Trevor Gamma", Number:"555-485-1212", Email:"tgamma@fictitious.com" };
var sampleItem4:Object = { Name:"Susan Delta",  Number:"555-987-3434", Email:"sdelta@fictitious.com" };     

dg.columns = ["Name","Number","Email"];
dg.addItem(sampleItem1);
dg.addItem(sampleItem2);
dg.addItem(sampleItem3);
dg.addItem(sampleItem4);

function gridRollOver(e:ListEvent):void
{
    trace("rowIndex: " + e.rowIndex + " columnIndex: " + e.columnIndex);    
}
dg.addEventListener(ListEvent.ITEM_ROLL_OVER, gridRollOver);
于 2013-09-27T19:51:47.723 回答