This content has been marked as final. Show 3 replies
By the way, Is it possible for a moderator to change my screen name to "tata668"? That would be really appreciated. I don't want to display my email address like this and I'm not able to change it in my profile!
I did find a way to workaround this issue if it can help someone.
I was doing sometimes like this (simplified here) to trigger the dragAndDrop:
dg.dragEnabled = true;
protected function myMouseDownHandler(event:MouseEvent):void
protected function myDragStartHandler(event:MouseEvent):void
The fix was to add a "true" when adding the mouseMove event:
this.addEventListener(MouseEvent.MOUSE_MOVE, myDragStartHandler, true);
That way my custom drag and drop management always starts before the default one and that workarounds the bug mentionned in my first message.
Update 2, if it can help someone:
Finally I don't manage the drag and drop by myself using DragManager.doDrag(...). Why? Because doing so if the user clicks on the scrollbars, on the datagrid header or on an empty row, it triggers the drag start and that is ugly. By letting Flex managing the drag and drop process, this doesn't append. BUT I was unable to use a custom proxy image then. Until I found this article:
The trick is:
1) save the mouseX and mouseY using the mousedown event.
2) override dragImage(), as the article says, to create your custom proxy, attaching to it a FlexEvent.UPDATE_COMPLETE event, saving it to a class variable and returning it.
3) When you receive the FlexEvent.UPDATE_COMPLETE event, you update the proxy position (that is saved in a class variable) using the saved mouseX and mouseY and you remove the listener to the event:
When you drop the proxy, you access the dragged items in : event.dragSource.dataForFormat("items")
Hope this helps, I spent lot of time trying to resolve this issue! Now it works perfectly! :-)