1 Reply Latest reply on Apr 25, 2008 4:59 AM by Wubsorz

    getting the drag image from the dragDrop handler

    dfduiud33
      How can I get the source of the image that's being dragged from within the dragDrop handler (the last one that''s called)?
      I know how to get the source from the mouseMove handler:

      Image(event.currentTarget).source

      But as I said I need it from within the dragDrop handler.

      Thanks a lot!
        • 1. Re: getting the drag image from the dragDrop handler
          Wubsorz
          What I currently have is a custom component and I wanted to show that custom component (called ContactSummary) during the dragging.

          I came up with the following code:

          Inside my dragIt(event:MouseEvent) method I create a dragProxy ..... this dragProxy will create the image for you.

          ......

          // Create a copy of the ContactSummary to use as a drag proxy.
          var dragProxy:ContactSummary = new ContactSummary();
          dragProxy = event.currentTarget as ContactSummary;

          This dragProxy is added in the doDrag method inside your DragManager:

          // Call the DragManager doDrag() method to start the drag.
          DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);