      *  Flag set to true if the application has temporarily set its explicit
      *  width and height to deal with orientation.
      */ 
-    private var restoreApplicationWidthAndHeight:Boolean = false;
-    
-    /**
-     *  @private
-     *  Caches the application's width and height values for the portrait
-     *  and landscape orientations.
-     */
-    private var cachedSizes:Object;
+    private var explicitSizingForOrientation:Boolean = false;
+    
+    /**
+     *  @private
+     *  Caches the application's width and height values for better resizing
+     *  of the screen during orientation changes. Keys are composed of the width and
+     *  height values in a string of the form "w:h", e.g. "1004:768" and represent
+     *  the screen dimensions before the orientation change. Values are
+     *  objects containing width and height properties that represent the screen dimensions
+     *  after the orientation change.
+     */
+    private var cachedDimensions:Dictionary;
+    
+    /**
+     *  @private
+     *  Previous width of the application prior to an orientation change 
+     */    
+    private var previousWidth:Number;
+    
+    /**
+     *  @private
+     *  Previous height of the application prior to an orientation change 
+     */    
+    private var previousHeight:Number;
+    
+    /**
+     *  @private
+     *  Flag to determine if the keyboard is active during an orientation change,
+     *  to minimize renders during the orientation change.
+     */
+    private var keyboardActiveInOrientationChange:Boolean = false;
     
     /**
      *  @private

        // based on the current SystemManager's width/height.
        // If developer has specified min/max values,
        // then application will not resize beyond those values.

        var w:Number;
        var h:Number


     */
    private function stage_orientationChange(event:Event):void
    {
        if (explicitSizingForOrientation)
        {
            // update cache if keyboard was not previously active
            if (!keyboardActiveInOrientationChange)
            {
                updateScreenSizeCache(stage.stageWidth / scaleFactor, stage.stageHeight / scaleFactor);
            }
            
            explicitSizingForOrientation = false;
        }
    }

    /**
     *  @private 
     *  Update the screen size cache with the new values. The previous values are
     *  pulled from the values currently set in the cache.
     *  Note that if the old and new width/height values are unchanged no values are
     *  cached under the assumption that this was a 180 degree rotation.
     * 
     */
    private function updateScreenSizeCache(newWidth:Number, newHeight:Number):void
    {
        // same dimensions, probably 180 degree rotation; don't cache
        if (previousWidth == newWidth && previousHeight == newHeight)
            return;
        
        var key:String = previousWidth + ":" + previousHeight;
        
        if (cachedDimensions[key])
        {
            // update the cached values if they are different
            cachedDimensions[key].width = newWidth;
            cachedDimensions[key].height = newHeight;
        }
        else
        {
            var orientationChangeKey:String = previousWidth + ":" + previousHeight;
            var reverseOrientationChangeKey:String = newWidth + ":" + newHeight;
            
            // cache values both ways, i.e. old -> new and new -> old
            cachedDimensions[orientationChangeKey] = {
                width:newWidth,
                height:newHeight
            };
            cachedDimensions[reverseOrientationChangeKey] = {
                width:previousWidth,
                height:previousHeight
            };
        }
    }
    
    
    
    /**
     *  @private
