This content has been marked as final. Show 3 replies
I feel your pain.
I wrote more then 50kb code in additional to existing mx:Tree code to support COPY, INSERT, DELETE operation on Tree and I wrote my own event handlers for dragDrop, dragOver and dragComplete events.
I just do not see the other way to accomplish this task.
As one of the author of Flash 8 based dndTree component http://drumbeatinsight.com/dndtree I can tell you that I am also not satisfied with the way how insertion point is calculated during drag'n'drop operation at mx:Tree.
I would rather prefer to display graphically a proposed insertion point (dndTree component uses a line symbol - see screenshot at http://drumbeatinsight.com/dndtree), but I do not know currently how to use the similar approach with mx:Tree component.
I managed to do the minimal work to get what I need: drag and copy items from one tree to another. I overrode Tree::dragDropHandler() -- if it is a MOVE operation, call super; otherwise, I copied the MOVE code in Tree.as (less than 50 lines) but removed the if(MOVE) checks; with a little cheating about namespace, the code simply works!
It's still beyond me why this behavior is not built-in in Tree.as.
BTW, thanks for the pointer to the new dnd doc!