 
             for (i = 0; i < n; i++)
             {
-                child = IUIComponent(getChildAt(i));
+                child = getLayoutChildAt(i);
 
                 if (!child.includeInLayout)
                     continue;


            for (i = 0; i < n; i++)
            {
                child = IUIComponent(getChildAt(i));

                if (!child.includeInLayout)
                    continue;

        var n:int = numChildren;
        for (var i:int = 0; i < n; i++)
        {
            var child:IUIComponent = getLayoutChildAt(i);

            if (!child.includeInLayout)
                continue;
