开发者

Drag Manager in Flex - how to get rid of the red cross?

I'm making a Matching Game, where I have some pictures on my left side and they can be dragged and dropped onto matching pictures on my right. I'm using the Drag Manager, which works great, but I have one problem. When dragging an 开发者_如何转开发object, I can see a small icon of a red cross, if the picture can not be dropped at this place (and it can't be dropped, if it doesn't match). Of course, in case of the game, I don't want the user to know instantly where he can drop the picture... Is there any way to get rid of this indicator?


I was wrong before. You need to accept the drag operation on dragEnter event handler if you want the "red cross" to disappear. Event if you try to display a different feedback, without accepting the drag operation the cross (meaning no operation) will still appear. So leave the check for the matching out of dragEnter handler and put in dragDrop event handler, and accept the drag for all your images.

Method hideDropFeedback is defined in the list components (List, DataGrid etc.), and it hides a certain line that appears when dragging items in those controls. This one doesn't matter in your particular case.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜