2 Replies Latest reply on Jul 6, 2010 6:46 AM by Kwangle

    How Do I Stop a Drag if the Mouse Pointer Leaves the Stage?

    Kwangle Level 1

      Hi All,

       

      I've got a large item on screen that can be dragged around by the mouse. I've simply put an invisible button on the item with:

       

      on(press) {

      this.startDrag();

      }

      on(release) {

      this.stopDrag();

      }

       

      but if I move the mouse pointer outside the stage area while dragging the item and release the mouse button the release is not detected and the drag stays activated and I have to bring the pointer back to the stage and click and release on the button again to stop the drag.

       

      Is there a way to deactivate a drag when the mouse is released outside the bounds of the stage, perhaps by using a different method that doesn't rely on a button?

       

      Any help is appreciated!