             for (var i:int = 0; i < n; i++)
             {
                 var child:IUIBase = contentView.getElementAt(i) as IUIBase;
-                if (child is ILayoutChild && !isNaN(ILayoutChild(child).percentHeight))
+                if (child == flexibleChild)
                 {
                     flexChildIndex = i;
                     break;

            var pl:Number = Number(paddingLeft);
            var pt:Number = Number(paddingTop);
            var pr:Number = Number(paddingRight);
            
            return {paddingLeft:pl, paddingTop:pt, paddingRight:pr};
        }


                horizontalMargins[i] = { marginLeft: ml, marginRight: mr, halign: halign };
            }

            for (i = n - 1; i > flexChildIndex; i--)
			{
				child = contentView.getElementAt(i) as IUIBase;
				margin = ValuesManager.valuesImpl.getValue(child, "margin");
