I can't think of an easy way to limit where something can be dragged, but if 
you check the dragInitiator on the DragEvent and it is not the same as the DG 
it is over, you can call preventDefault() on the DragEvent and deny the drop.  
There should be doc on how to deny drops by calling preventDefault on 
DragEvents.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of invertedspear
Sent: Monday, December 14, 2009 2:03 PM
To: [email protected]
Subject: [flexcoders] Easy (I hope) drag and drop question



I searched but couldn't find my answer, I'm sure it's easy for anyone with a 
little experience. I have multiple datagrids on a page, each one I want 
sortable with drag and drop, but I don't want items drug from one control to 
the other. How can I prevent a user from dragging an item out of a conrol. I 
would prefer to have it just stop moving with the mouse, but I am prepared to 
just completely cancel out of the dragging if need be.
I was trying to do something like this

dragExit="dragEvent.CANCEL"

This is obviously wrong, but I can't find the correct way to do it.

Thanks in advance. ~Mike

Reply via email to