      *  application to resize itself and fix the scroll position if necessary
      */ 
     private function softKeyboardDeactivateHandler(event:SoftKeyboardEvent):void
-    {   
+    {
         // Adjust the scroll position after the application's size is restored. 
         adjustScrollPositionAfterSoftKeyboardDeactivate();
+        isSoftKeyboardActive = false;
     }
     
     /**
      *  @private
      */ 
     mx_internal function adjustScrollPositionAfterSoftKeyboardDeactivate():void
-    {      
-        // If contentHeight is shorter than height, we no longer can scroll and we should reset to 0
-        // If contentHeight is taller than height, make sure the position doesn't 
-        // exceed the max scroll position
-        
-        if (viewport.contentHeight <= height)
-            viewport.verticalScrollPosition = 0;
+    {   
+        // If the throw animation is still playing, stop it. Otherwise, fix the 
+        // scroll position. 
+        if (throwEffect && throwEffect.isPlaying)
+            stopThrowEffectOnMouseDown();
         else
-            viewport.verticalScrollPosition = Math.min(viewport.verticalScrollPosition, viewport.contentHeight - height);
-        
-        if (viewport.contentWidth <= width)
-            viewport.horizontalScrollPosition = 0;
-        else
-            viewport.horizontalScrollPosition = Math.min(viewport.horizontalScrollPosition, viewport.contentWidth - width);
-    }
-
+            snapContentScrollPosition();
+    }
 
 }
 

     */
    private var inTouchInteraction:Boolean = false;
    
    /**
     *  @private
     *  Keeps track of whether the Scroller is listening for softKeyboardEvents 
     */    
    private var softKeyboardEventHandlersAdded:Boolean = false;
    
    /**
     *  @private 
     */ 
    private var lastFocusedElement:IVisualElement;
    
    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------
    
    //----------------------------------
    //  ensureFocusedElementIsVisible
    //---------------------------------- 
    
    /**
     *  Some devices do not support a hardware keyboard. 
     *  Instead, these devices use a keyboard that opens on 
     *  the screen when necessary. 
     *  A value of <code>true</code> means that when a component in 
     *  the container wrapped by the scroller receives focus, 
     *  the Scroller scrolls that component into view.
     *
     *  <p>When the keyboard closes, the parent container might be smaller 
     *  than the available screen space. 
     *  If the container is smaller than the available screen space, 
     *  then the Scroller restores the scroll positions to 0, 
     *  the top of the wrapped container.</p>
     * 
     *  @default true
     *  
     *  @langversion 3.0
     *  @playerversion Flash 10
     *  @playerversion AIR 1.5
     *  @productversion Flex 4
     */ 
    public var ensureFocusedElementIsVisible:Boolean = true;
    
    //----------------------------------
    //  horizontalScrollBar

    
    //--------------------------------------------------------------------------
    // 
    // Methods
    //
    //--------------------------------------------------------------------------
    
    /**
     *  Scrolls the viewport so the element is visible in the viewable area
     *  Adjusts for focusThickness.
     * 
     *  @param element A descendant element of the Scroller  
     */ 
    public function ensureElementIsVisible(element:IVisualElement):void
    {   
        // First check that the element is a descendant
        // If we are a GraphicElement, use the element's parent
        var possibleDescendant:DisplayObject = element as DisplayObject;
        
        if (element is IGraphicElement)
            possibleDescendant = IGraphicElement(element).parent as DisplayObject;
        
        if (!possibleDescendant || !contains(possibleDescendant))
            return;
        
        var layout:LayoutBase = null;
        
        if (viewport is GroupBase)
            layout = GroupBase(viewport).layout;
        else if (viewport is SkinnableContainer)
            layout = SkinnableContainer(viewport).layout;
        
        if (layout)
        {
            // Scroll the element into view
