                                                                 spaceToDistribute,
                                                                 totalPercentWidth,
                                                                 childInfoArray);
+            
             for each (childInfo in childInfoArray)
             {
-            	newHeight = NaN;
-            	if (hasPercentHeight(childInfo.layoutItem))
-            	   newHeight = calculatePercentHeight(childInfo.layoutItem, height);
-
-                childInfo.layoutItem.setActualSize(childInfo.size, newHeight);
+                sizeLayoutItem(childInfo.layoutItem, height, verticalAlign, 
+                               restrictedHeight, childInfo.size, 
+                               variableColumnWidth, cw); 
             }
         }
         return spaceToDistribute;

     *  The return value is any extra space that's left over
     *  after growing all children to their maxWidth.
     */
    public function distributeWidth(layoutItemArray:Array,
                                     width:Number,
                                     height:Number):Number
    {
        var spaceToDistribute:Number = width;
        var totalPercentWidth:Number = 0;
        var childInfoArray:Array = [];
        var childInfo:HLayoutItemFlexChildInfo;
        var newHeight:Number;
        
        // If the child is flexible, store information about it in the
        // childInfoArray. For non-flexible children, just set the child's
        // width and height immediately.
        for each (var layoutItem:ILayoutItem in layoutItemArray)
        {
            if (hasPercentWidth(layoutItem))
            {
                totalPercentWidth += layoutItem.percentWidth;


            return;
        
        // TODO EGeorgie: use vector
        var layoutItem:ILayoutItem;
        var count:uint = layoutTarget.numLayoutItems;
        
        // if verticalAlign is "contentJustify", we need to figure out contentHeight.
        // contentHeight gets sent in to distributeWidth(), but is only used if 
        // verticalAlign is "justify" (contentHeight is unscaledHeight) or 
        // verticalAlign is "contentJustify" (contentHeight is the maximum height
        // of all its children and a minimum of unscaledHeight)
        var contentHeight:Number = unscaledHeight;
        
        if (verticalAlign != VerticalAlign.TOP)
        {
            for (var i:int = 0; i < count; i++)
            {
                layoutItem = layoutTarget.getLayoutItemAt(i);
                if (!layoutItem || !layoutItem.includeInLayout)
                    continue;
                
                var layoutItemHeight:Number;
                if (hasPercentHeight(layoutItem))
                    layoutItemHeight = calculatePercentHeight(layoutItem, unscaledHeight);
                else
                    layoutItemHeight = layoutItem.preferredSize.y;
                    
                contentHeight = Math.max(contentHeight, layoutItemHeight);
            }
        }

        distributeWidth(unscaledWidth, unscaledHeight, contentHeight); 
        
        // default to top (0)
        var vAlign:Number = 0;
        if (verticalAlign == VerticalAlign.MIDDLE)
            vAlign = .5;
        else if (verticalAlign == VerticalAlign.BOTTOM)
            vAlign = 1;
        
        // If columnCount wasn't set, then as the LayoutItems are positioned
        // we'll count how many columns fall within the layoutTarget's scrollRect
