     /**
      *  @inheritDoc
      */
-	public function apply(parent:UIComponent):void
-	{
-		removed = false;
-		
-		if (target.parent)
-		{
-			oldParent = target.parent;
-			oldIndex = oldParent.getChildIndex(target);
-			oldParent.removeChild(target);
-			removed = true;
-		}
-	}
+    public function apply(parent:UIComponent):void
+    {
+        removed = false;
+        
+        var obj:* = getOverrideContext(target, parent);
+        
+        if ((obj is DisplayObject) && obj.parent)
+        {
+            oldParent = obj.parent;
+            oldIndex = oldParent.getChildIndex(obj);
+            oldParent.removeChild(obj);
+            removed = true;
+        }
+    }
 
-	/**
+    /**
      *  @inheritDoc
-	 */
-	public function remove(parent:UIComponent):void
-	{
-		if (removed)
-		{
-			oldParent.addChildAt(target, oldIndex);
+     */
+    public function remove(parent:UIComponent):void
+    {
+        var obj:* = getOverrideContext(target, parent);
+        
+        if (removed && (obj is DisplayObject))
+        {
+            oldParent.addChildAt(obj, oldIndex);
 
-			// Make sure any changes made while the child was removed are reflected
-			// properly.
-			if (target is UIComponent)
-				UIComponent(target).mx_internal::updateCallbacks();
+            // Make sure any changes made while the child was removed are reflected
+            // properly.
+            if (obj is UIComponent)
+                UIComponent(target).mx_internal::updateCallbacks();
 
-			removed = false;
-		}
-	}
+            removed = false;
+        }
+    }
 }
 
 }


    /**
     *  Constructor.
	 *
	 *  @param target The child to remove from the view.
     */
	public function RemoveChild(target:DisplayObject = null)
	{
		super();

		this.target = target;
	}

    //--------------------------------------------------------------------------
    //


import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;

import mx.core.UIComponent;

/**
