move mouse-up listener to the stage, should fix #3410
authorRichard Fairhurst <richard@systemed.net>
Mon, 7 Mar 2011 13:23:09 +0000 (13:23 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 9 Mar 2011 11:27:22 +0000 (11:27 +0000)
net/systemeD/potlatch2/Toolbox.mxml

index 135629a..e15b50f 100644 (file)
                override protected function createChildren():void {
                        super.createChildren();
                        super.titleBar.addEventListener(MouseEvent.MOUSE_DOWN,handleDown);
-                       super.titleBar.addEventListener(MouseEvent.MOUSE_UP,handleUp);
                }
 
                public function updateSelectionUI():void {
 
                private function handleDown(e:Event):void {
                        this.startDrag();
+                       stage.addEventListener(MouseEvent.MOUSE_UP,handleUp);
                }
 
                private function handleUp(e:Event):void {
                        this.stopDrag();
+                       stage.removeEventListener(MouseEvent.MOUSE_UP,handleUp);
                }
                
                public function toggle():void {