Here a fairly simple question yet I can't find an awnser anywhere.
I'm droping an object on one of my component which is HBox based and everything works fine execept for the fact that I can only do the drop when I'm on the HBox border or one of the objects it contains. Do I need to set something so the HBox background accepts the drop ... ?
Code:
// Check if drag proxy has format ...
private function doDragEnter(event:DragEvent):void{
if(event.dragSource.hasFormat('treeItems'))
DragManager.acceptDragDrop(IUIComponent(event.target));
}
// Performs the drop op.
private function doDragDrop(event:DragEvent):void{
var items:Object = event.dragSource.dataForFormat("treeItems");
for (var i:int=0; i<items.length; i++)
Object(dataBox.getChildAt(i))._value.text = '#ref('+items[i].@id+':'+items[i].localName()+')';
}
and in Init() I add the two event listners.
Code:
this.addEventListener(DragEvent.DRAG_ENTER, doDragEnter);
this.addEventListener(DragEvent.DRAG_DROP, doDragDrop);
thanks for your help.