2 Replies Latest reply on Mar 15, 2007 7:22 AM by darkfrog26

    Popup Live Move

    darkfrog26 Level 1
      I'm extending TitleWindow to be bound to certain constraints when being moved and I've gotten it to work now, but my problem is that the change to move it within the boundary area is only occurring after I release the mouse button.

      I can drag the window anywhere I want but when I release the button it updates to put it within the boundary it should be in. I want to have a solid boundary that the window can never be moved outside of. I've added listeners for MOUSE_MOVE, MOUSE_OUT, and MOUSE_DOWN and my validation method does the following:

      private function validateWindow():void {
      if (container != null) {
      var changed:Boolean = false;
      if (x < container.x) {
      x = container.x;
      changed = true;
      }
      if (y < container.y) {
      y = container.y;
      changed = true;
      }
      if (changed) {
      invalidateProperties();
      }
      }
      }

      container is the UIComponent the window should be constrained inside of.
        • 1. Re: Popup Live Move
          darkfrog26 Level 1
          Further consideration of this makes me think the problem is that the mouse is dragging the window so even if it happily accepts my change it immediately overrides it because the mouse cursor position is constantly keeping it in place.

          I guess my question changes to, can I change the mouse cursor position via ActionScript?
          • 2. Re: Popup Live Move
            darkfrog26 Level 1
            I figured out the solution myself. For anyone that is interested I was able to resolve the issue by using a MoveEvent listener instead of MouseEvent listeners.