             __lastMouseDown.__globalmouseup(event);
             __lastMouseDown = null;
         } else {
-            if (__mouseLeft && event.buttonDown) {
+            if (__mouseLeft) {
                 __mouseLeft = false;
-                __mouseUpOutsideHandler();
+                if (event.buttonDown) __mouseUpOutsideHandler();
             }
             __sendEvent(null, eventname);
         }

            LFCApplication.stage.addEventListener(MouseEvent.MOUSE_UP,   __mouseHandler);
            LFCApplication.stage.addEventListener(MouseEvent.MOUSE_DOWN, __mouseHandler);
            LFCApplication.stage.addEventListener(MouseEvent.MOUSE_WHEEL, __mouseWheelHandler);
            LFCApplication.stage.addEventListener(Event.MOUSE_LEAVE, __mouseLeavesHandler);
            __listeneradded = true;
        }
    }    

    }

    // handles MOUSE_LEAVE event
    static function __mouseLeaveHandler(event:Event = null):void {
        __mouseLeft = true;
        __sendEvent(null, 'onmouseleave');
    }

    static function __mouseWheelHandler(event:MouseEvent):void {
