      */ 
     private function softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void
     {
-        if (this === FlexGlobals.topLevelApplication)
+        if (this === FlexGlobals.topLevelApplication && isSoftKeyboardActive)
         {            
+            if (softKeyboardTarget)
+                clearSoftKeyboardTarget();
+            
             isSoftKeyboardActive = false;
             
             if (softKeyboardBehavior == "none" && resizeForSoftKeyboard)

    {        
        if (this === FlexGlobals.topLevelApplication)
        {
            // Get the keyboard size
            var keyboardRect:Rectangle = stage.softKeyboardRect;
     

        if (hasEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR))
            systemManager.loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorRedispatcher);

        // Determine if we are running on an iOS device
        isIOS = Capabilities.version.indexOf("IOS") == 0;
        
        // To prevent a flicker described in SDK-30133, a flex application listens
        // for orientationChanging events dispatched by iOS AIR applications.
        // In the handler, the stage's width and height are swapped, and a validation
