         if (stageTextVisibleChangePending)
         {
             stageText.visible = stageTextVisible;
+
+            // The focused stageText may have been replaced by a bitmap during
+            // an animation. When restoring its visibility, restore its focus as
+            // well if the soft keyboard is open. (If the soft keyboard is not
+            // open, do not restore focus because doing so will force the soft
+            // keyboard to open.)
+            if (stageTextVisible && stageText == focusedStageText && 
+                stage.softKeyboardRect.height > 0)
+            {
+                stageText.assignFocus();
+            }
+            
+            // Do not remove the proxy bitmap until after stageText has been
+            // made visible to reduce flicker.
+            if (stageTextVisible && textImage != null)
+            {
+                removeChild(textImage);
+                textImage.bitmapData.dispose();
+                textImage = null;
+            }
+
             stageTextVisibleChangePending = false;
         }
     }

    {
        super();
        
        // This needs to be true so that we can show the soft keyboard if the
        // user taps on the padding instead of on the StageText. If 
        // needsSoftKeyboard isn't set to true, requestSoftKeyboard would do
        // nothing.
        needsSoftKeyboard = true;
                
        _multiline = multiline;
        getStageText(true);
        

                    stageTextVisibleChangePending = true;
                    addEventListener(Event.ENTER_FRAME, enterFrameHandler);
                }
            }
        }
    }
