0 Replies Latest reply on Feb 29, 2008 2:06 PM by ericbelair

    DragManager.doDrag() not initiating

    ericbelair Level 1
      I have following listener function used to initiate a drag of a UI Component in my application:

      // Handler for Mouse Over + Mouse Down event
      private function dragStartHandler(mouseEvent:MouseEvent):void
      // Initiate a new Drag Event if one is not currently in progress
      if (!DragManager.isDragging)
      // Get the drag initiator component from the event object.
      dragInitiator = component(mouseEvent.currentTarget);

      // Create a DragSource object.
      ds = new DragSource();

      // Add the Widget Class from the source Widget Panel to the Drag Source
      ds.addData(dragInitiator.widget, "_sourceWidget");

      var proxy:Box = new Box();

      // Initiate the Drag Event
      DragManager.doDrag(dragInitiator, ds, mouseEvent, proxy);

      The first time that the function is called, the drag is not initiated. However, after this, the drag is initiated every time without a hitch. I have confirmed that my listener is working, by showing an Alert in the function, just before the doDrag call, and the Alert pops on the first try, but it appears that the doDrag is doing nothing on that first try.

      Any thoughts on why this is happening, and how I can fix it?

      Thank you.