         
         synchronousResize = (parseFloat(version[0]) > 10 ||
                              (parseFloat(version[0]) == 10 && parseFloat(version[1]) >= 1)) && (Capabilities.playerType != "Desktop" || runningOnMobile);
+    }
+    
+    /**
+     *  @private
+     *  Called if resizeForSoftKeyboard is true and the softKeyboard
+     *  has been activated. 
+     */    
+    private function softKeyboardActivateHandler(event:SoftKeyboardEvent):void
+    {
+        if (this === FlexGlobals.topLevelApplication)
+        {
+            // Get the keyboard size
+            var keyboardRect:Rectangle = stage.softKeyboardRect;
+                        
+            var sm:SystemManager = systemManager as SystemManager;
+            var scaleFactor:Number = 1;
+            
+            // Account for any density scaling
+            if (sm)
+                scaleFactor = sm.densityScale;
+            
+            var appHeight:Number = (stage.stageHeight - keyboardRect.height) / scaleFactor;
+            
+            if (appHeight != height)
+            {                
+                setActualSize(width, appHeight);
+                validateNow(); // Validate so that other listeners like Scroller get the updated dimensions
+            }
+        }
+    }
+    
+    /**
+     *  @private
+     *  Called if resizeForSoftKeyboard is true and the softKeyboard
+     *  has been deactivated. 
+     */ 
+    private function softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void
+    {
+        if (this === FlexGlobals.topLevelApplication)
+        {
+            // Get the keyboard size
+            var keyboardRect:Rectangle = stage.softKeyboardRect;
+            
+            var sm:SystemManager = systemManager as SystemManager;
+            var scaleFactor:Number = 1;
+            
+            // Account for any density scaling
+            if (sm)
+                scaleFactor = sm.densityScale;
+            
+            // Restore the original values
+            setActualSize(stage.stageWidth / scaleFactor, stage.stageHeight / scaleFactor);
+            
+            validateNow(); // Validate so that other listeners like Scroller get the updated dimensions
+        }
+    }
+    
+    /**
+     *  Helper function to get the AIR application descriptor attribute called "softKeyboardBehavior". 
+     */  
+    mx_internal static function get softKeyboardBehavior():String
+    {
+        if (_softKeyboardBehavior != null)
+        {
+            return _softKeyboardBehavior;
+        }
+        else
+        {
+            // Since we might not be running on AIR, need to get the class by name. 
+            // Also, make sure to cache the value so we only run this once
+            var nativeApp:Object = FlexGlobals.topLevelApplication.systemManager.getDefinitionByName("flash.desktop.NativeApplication");
+            
+            if (nativeApp)
+            {
+                var appXML:XML = XML(nativeApp["nativeApplication"]["applicationDescriptor"]);
+                var ns:Namespace = appXML.namespace();
+                
+                _softKeyboardBehavior = String(appXML..ns::softKeyboardBehavior);
+            }
+            else
+            {
+                _softKeyboardBehavior = "";
+            }
+            
+            return _softKeyboardBehavior;
+        }
     }
 
     //--------------------------------------------------------------------------

import mx.managers.IActiveWindowManager;
import mx.managers.ILayoutManager;
import mx.managers.ISystemManager;
import mx.managers.ToolTipManager;
import mx.styles.CSSStyleDeclaration;
import mx.styles.StyleManager;

    /**
     *  @private
     */
    private var softKeyboardHandlersAdded:Boolean = false;
    
    private static var _softKeyboardBehavior:String = null;
    
    /**
     *  @private
     */
    private var synchronousResize:Boolean = false;

    /**
