我正在将一个列表项拖到一个组中。该列表如下所示:
<s:List id="lstArtists" dragEnabled="true" dragMoveEnabled="true"/>
该组有 dragenter- en dragdrophandlers:
<s:Group id="groupRemove" dragEnter="dragEnterHandler(event)" dragDrop="dragDropHandler(event)">
<s:Image source="assets/images/trashcan.jpg" horizontalCenter="0" verticalCenter="0"/>
</s:Group>
这些是处理程序:
protected function dragEnterHandler(event:DragEvent):void
{
if(Object(event.dragInitiator).id == "lstArtists")
{
DragManager.acceptDragDrop(event.target as UIComponent);
}
}
protected function dragDropHandler(event:DragEvent):void
{
Alert.show(String(event.draggedItem));
}
但 draggedItem 为空:
如何访问拖动的项目?