                 return child;
             }
             else        
-                child.parent.removeChild(child);
-        
-        }
+                child.parent.removeChild(child);        
+        }
+
+        if ((_layeringFlags & LAYERING_ENABLED) || 
+        	(item is IVisualElement && (item as IVisualElement).layer != 0))
+        	invalidateLayering();
             
         return super.addChildAt(child, index != -1 ? index : super.numChildren);
     }

    }
    
    /**
     *  Adds an item to this DataGroup.
     *  Flex calls this method automatically; you do not call it directly.
     *

            myItemRenderer = createRendererForItem(item, index);
        }
        

        registerRenderer(index, myItemRenderer);
        
        if (myItemRenderer is GraphicElement)
