     //  Methods: UIComponent
     //
     //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function parentChanged(p:DisplayObjectContainer):void
+    {
+        if (focusManager)
+        {
+            focusManager.removeEventListener(FlexEvent.FLEX_WINDOW_ACTIVATE, 
+                _textContainerManager.activateHandler)
+            focusManager.removeEventListener(FlexEvent.FLEX_WINDOW_DEACTIVATE, 
+                _textContainerManager.deactivateHandler)
+        }
+
+        super.parentChanged(p);
+
+        if (focusManager)
+        {
+            focusManager.addEventListener(FlexEvent.FLEX_WINDOW_ACTIVATE, 
+                _textContainerManager.activateHandler, false, 0, true)
+            focusManager.addEventListener(FlexEvent.FLEX_WINDOW_DEACTIVATE, 
+                _textContainerManager.deactivateHandler, false, 0, true)
+        }
+        else
+        {
+            // if no focusmanager yet, add capture phase to detect when it
+            // gets added
+            systemManager.getSandboxRoot().addEventListener(FlexEvent.ADD_FOCUS_MANAGER, 
+                    addFocusManagerHandler, true, 0, true)
+        }
+
+    }
 
     /**
      *  @private


        _textContainerManager.editingMode = value;
    }

    //----------------------------------
    //  heightInLines

            invalidateDisplayList();
        } 
    }    

}

}
