简体   繁体   中英

Drag and Drop to a Sprite in Flex

I need to detect when a user dbnd an object into a sprite. I'm adding the 3 event listeners I need, but only one of them works:

ontainer.addEventListener( DragEvent.DRAG_ENTER, dragEnterHandler); container.addEventListener( DragEvent.DRAG_EXIT, dragExitHandler); container.addEventListener( DragEvent.DRAG_DROP, dragDropHandler);

The only one I can listen to is DRAG_ENTER. And I'm using to accept the dragged object:

DragManager.acceptDragDrop(event.currentTarget.parent as IUIComponent);

Any ideas why I can't listen to the other two events?

tks.

From the documentation ...

To accept the drop, the event handler calls the DragManager.acceptDragDrop() method. You must call the DragManager.acceptDragDrop() method for the drop target to receive the dragOver, dragExit, and dragDrop events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM