             var lastmb:Number;
             var lastmt:Number;
             var halign:Object;
+            var left:Number;
+            var right:Number;
             
             for (var i:int = 0; i < n; i++)
             {
                 var child:IUIBase = contentView.getElementAt(i) as IUIBase;
+                ilc = child as ILayoutChild;
+                left = ValuesManager.valuesImpl.getValue(child, "left");
+                right = ValuesManager.valuesImpl.getValue(child, "right");
                 if (child == actualChild)
                 {
                     flexChildIndex = i;

                {
                    ilc = child as ILayoutChild;
                    if (!isNaN(ilc.percentWidth))
                        ilc.setWidth(contentView.width * ilc.percentWidth / 100, true);
                }
                maxWidth = Math.max(maxWidth, ml + child.width + mr);
                child.y = yy + mt;
                yy += child.height + mt + mb;
                lastmb = mb;
                halign = ValuesManager.valuesImpl.getValue(child, "horizontal-align");
                horizontalMargins[i] = { marginLeft: ml, marginRight: mr, halign: halign };
            }

            if (n > 0 && n > flexChildIndex)

                for (i = n - 1; i > flexChildIndex; i--)
    			{
    				child = contentView.getElementAt(i) as IUIBase;
                    ilc = child as ILayoutChild;
                    left = ValuesManager.valuesImpl.getValue(child, "left");
                    right = ValuesManager.valuesImpl.getValue(child, "right");
    				margin = ValuesManager.valuesImpl.getValue(child, "margin");
    				if (margin is Array)
    				{
