     {
         try
         {
-            if (propertyName == null && (dest is Group || dest is FxContainer))
-                return dest.getItemIndex(object);
+            if (propertyName == null && (dest is IVisualElementContainer))
+                return IVisualElementContainer(dest).getElementIndex(object);
             
             if (propertyName == null && dest is IChildList)
                 return IChildList(dest).getChildIndex(DisplayObject(object));

import mx.core.IChildList;
import mx.core.IDeferredInstance;
import mx.core.UIComponent;

[DefaultProperty("itemsFactory")]


                break;
        }    
        
        if ( (propertyName == null || propertyName == "content") && (dest is IVisualElementContainer))
        {
            addItemsToContentHolder(dest as IVisualElementContainer, localItems);
        }
        else if (propertyName == null && dest is IChildList)
        {
