4 Replies Latest reply on Jun 4, 2008 4:32 AM by

    Stop TitleWindow from dragging

      Hi,

      I want to disable (and enable again) the dragging of the titlewindow that is created by a popupmanager.
      The thing is that .stopdrag(); does not work. Anybody knows how to disable the dragging of a titlewindow?

      thanks.
        • 1. Re: Stop TitleWindow from dragging
          atta707 Level 2
          can you live with no header on your window? If so, setting headerHeight="0" would be fastest way to get around this problem.
          1 person found this helpful
          • 2. Stop TitleWindow from dragging
            No sorry, need to have a header, is there a way to block the mouse only on the header but not on the children that are in the titlewindow?

            p.s. the close window button should work :)
            • 3. Re: Stop TitleWindow from dragging
              atta707 Level 2
              I thought so! So let's get ready to extend Titlewindow class and override startDraggin() method. We leave the body empty; that is, we don't let this call go up to the parent class and lose dragging.

              Here is a non-dragable title window component:

              <?xml version="1.0" encoding="utf-8"?>
              <mx:TitleWindow xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"
              showCloseButton="true" close="PopUpManager.removePopUp(this);">

              <mx:Script>
              <![CDATA[
              import mx.managers.PopUpManager;

              override protected function startDragging(event:MouseEvent):void {
              }
              ]]>
              </mx:Script>

              </mx:TitleWindow>
              • 4. Re: Stop TitleWindow from dragging
                Overriding the function is the way to go. (I already had a dirty other workaround by firing the MOUSE_UP event when START dragging (but you can see some pixel shifting :)

                thanks!