2 Replies Latest reply on Aug 21, 2007 12:39 AM by aubweb

    Air : Drag TitleWindow with titleBar

    aubweb Level 1
      Hi,

      I made a special classe that extends a TitleWindow in a Air project.
      When I do a MouseDown on the tileBar , I drag the TitleWindow ( stage.window.startMove(); )

      But my problem is that in my tileBar I've put a textInput and when I want to select the text of my TextInput it drags the window...

      How can I resolve that issue ?

      Thanks !

      Happy Flex Developping every1 ;-)
        • 1. Re: Air : Drag TitleWindow with titleBar
          flexPro Level 1
          There are a couple of solutions I can think of off the top of my head for this.

          1. Instead of listening for mouse down on the titleBar, listen for mouseMove and, within the listener, start dragging only if the mouse button is down. This isn't foolproof, but works pretty well.

          2. (and better than 1) Add a mouseDown event listener to the TextInput in your title bar and, within it, simply call event.stopPropogation() (you can do this inline within MXML by adding: mouseDown="event.stopPropagation()"). This will prevent the event from being processed by any listeners in nodes subsequent to the current node in the event flow (including the TitleBar).
          • 2. Re: Air : Drag TitleWindow with titleBar
            aubweb Level 1
            Thank you for your quick and clear answer !

            have a good day.