简体   繁体   English

在Flex中拖放到Sprite

[英]Drag and Drop to a Sprite in Flex

I need to detect when a user dbnd an object into a sprite. 我需要检测用户何时将对象dbnd变成精灵。 I'm adding the 3 event listeners I need, but only one of them works: 我添加了我需要的3个事件侦听器,但是其中只有一个可以工作:

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. 我只能听的是DRAG_ENTER。 And I'm using to accept the dragged object: 我用来接受拖动的对象:

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

Any ideas why I can't listen to the other two events? 有什么想法为什么我不能听其他两个事件吗?

tks. tks。

From the documentation ... 文档中 ...

To accept the drop, the event handler calls the DragManager.acceptDragDrop() method. 为了接受放置,事件处理程序调用DragManager.acceptDragDrop()方法。 You must call the DragManager.acceptDragDrop() method for the drop target to receive the dragOver, dragExit, and dragDrop events. 您必须为放置目标调用DragManager.acceptDragDrop()方法,以接收dragOver,dragExit和dragDrop事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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