2 Replies Latest reply on Jan 29, 2010 9:02 AM by Faser

    TitleWindow no more draggable

    Faser

      The TitleWindow is draggable from the TitleBar, but when the TitleBar is moved out of the screen the window is no more draggable.
      There is no way to close the window too. How can I prevent this behavior?
      Is there a property to enable the window to be dragged using any available space on the window?

        • 1. Re: TitleWindow no more draggable
          Francisc Level 3

          To prevent that from happening you must add listeners and if the top (x,y) of the window goes over the (0,0) point, stop the drag or something simmilar.

           

          To enable dragging from any part of the TitleWindow, you can do this:

           

          this.addEventListener(MouseEvent.MouseDown,startMove);

           

          private function startMove(event:MouseEvent):void

          {

               this.startMove();

          }

           

          You do not need to create a listener for stopping the move.

          1 person found this helpful
          • 2. Re: TitleWindow no more draggable
            Faser Level 1

            Thank you for your tip. I found a little different way but it works.

             

            <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
                            layout="absolute" width="640" height="480"              
                            showCloseButton="true"               
                            close="PopUpManager.removePopUp(this);"
                            creationComplete="init();"
                            mouseDown="startMove(event)"
                            mouseUp="stopMove(event)">

             

            private function startMove(evt:MouseEvent):void {
                         this.startDrag();

            }
                   
            private function stopMove(evt:MouseEvent):void {
                       this.stopDrag();
                    }