      */
     private var deferredViewPortUpdate:Boolean = false;
     
+   /*
+    * Along with the text, need to save the selection, when the StageText is removed from
+    * the stage, so that when the StageText is restored, the selection can be restored.
+    */
+    private var savedSelectionAnchorIndex:int = 0;
+    private var savedSelectionActiveIndex:int = 0;
+            
     //--------------------------------------------------------------------------
     //
     //  Overridden properties

    private var _text:String = "";
    
    /**
     *  @copy flash.text.StageText#text
     * 
     *  @default null
     * 
     *  @langversion 3.0
     *  @playerversion AIR 3.0

        if (value == null)
            value = "";
        
        // Like TextField, preserve the selection when setting text.  This is necessary so that
        // if there is a binding to the text property, the insertion poiint doesn't reset after 
        // every character typed.
        if (stageText != null)
        {
            var anchorIndex:int = stageText.selectionAnchorIndex;
            var activeIndex:int = stageText.selectionActiveIndex;
            stageText.text = value;
            stageText.selectRange(anchorIndex, activeIndex);
        }
        _text = value;
    }
    
