I try to past the events DragEnter in first and then DragDrop :
DragBar.mxml :
<mx:Script>
<![CDATA[
public static const ARCHIVE_DRAG_DROP:String = 'archiveDragDrop';
public static const ARCHIVE_DRAG_ENTER:String = 'archiveDragEnter';
private function sendDragEvent( action:String ):void
{
dispatchEvent(new DragEvent( action, true ));
}
]]>
</mx:Script>
<mx:LinkButton id="archiveButton" label="Archive"
icon="{archiveIcon}"
dragDrop="sendDragEvent(ARCHIVE_DRAG_DROP)"
dragEnter="sendDragEvent(ARCHIVE_DRAG_ENTER)"
toolTip="Drop an element here for archiving" />
DragBarMediator.mxml :
public function UniverseDragBarMediator(viewComponent:Object=null)
{
super(NAME, viewComponent);
// Add Listeners
universeDragBar.addEventListener( UniverseDragBar.ARCHIVE_DRAG_DROP, onArchiveDragDrop );
universeDragBar.addEventListener( UniverseDragBar.ARCHIVE_DRAG_ENTER, onArchiveDragEnter );
}
private function onArchiveDragEnter( event:DragEvent ):void
{
var obj:IUIComponent = IUIComponent(event.currentTarget);
DragManager.acceptDragDrop(obj);
}
private function onArchiveDragDrop( event:DragEvent ):void
{
sendNotification( ProjectManagerFacade.ARCHIVE_ELEMENT );
}
I follow the flow with PureMVC Console and I saw that only the event dragEnter is dispatched.
With the same code in first post, the both are dispatched.
Have you an explanation
Thanks for your help Cliff