             }
             
             // Get the keyboard size
-            var keyboardRect:Rectangle = stage.softKeyboardRect;
+            var keyboardRect:Rectangle = softKeyboardRect;
      
             if (keyboardRect.height > 0)
                 isSoftKeyboardActive = true;

		// softKeyboard becoming visible, we need to compare against
		// the height without the keyboard active
		if (isSoftKeyboardActive && softKeyboardBehavior == "none" && resizeForSoftKeyboard)
			actualHeight += stage.softKeyboardRect.height;
		
        return width > actualHeight ? "landscape" : "portrait";
    }

        if (!dispatchEvent(event))
            event.preventDefault();
    }
	
	mx_internal var _softKeyboardRect:Rectangle;
	
	mx_internal function get softKeyboardRect():Rectangle
	{
		if (_softKeyboardRect == null)
			return stage.softKeyboardRect;
		
		return _softKeyboardRect;
	}
}

}
