         var maxY:Number = 0;
         var firstRowInView:int = -1;
         var lastRowInView:int = -1;
-
-        // rowHeight can be expensive to compute
-        var rh:Number = (variableRowHeight) ? 0 : rowHeight;
         
         for (var index:int = 0; index < count; index++)
         {
             layoutItem = layoutTarget.getLayoutItemAt(index);
             if (!layoutItem || !layoutItem.includeInLayout)
                 continue;
-
-        	// Set the layout item's acutual size and position
-            var x:Number = (unscaledWidth - layoutItem.actualSize.x) * hAlign;
+                
+            // Set the layout item's position
+            var x:Number = (contentWidth - layoutItem.actualSize.x) * hAlign;
             layoutItem.setActualPosition(x, y);
-            var dx:Number = layoutItem.actualSize.x;
-            if (!variableRowHeight)
-                layoutItem.setActualSize(dx, rh);
                 
             // Update maxX,Y, first,lastVisibleIndex, and y
+            var dx:Number = layoutItem.actualSize.x;
             var dy:Number = layoutItem.actualSize.y;
             maxX = Math.max(maxX, x + dx);
             maxY = Math.max(maxY, y + dy);

     *  The return value is any extra space that's left over
     *  after growing all children to their maxHeight.
     */
    public function distributeHeight(layoutItemArray:Array,
                                     width:Number,
                                     height:Number):Number
    {
        var spaceToDistribute:Number = height;
        var totalPercentHeight:Number = 0;
        var childInfoArray:Array = [];
        var childInfo:LayoutItemFlexChildInfo;
        var newWidth: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 (hasPercentHeight(layoutItem))
            {
                totalPercentHeight += layoutItem.percentHeight;


            }
            else
            {
                sizeLayoutItem(layoutItem, width, horizontalAlign, 
                               restrictedWidth, NaN, variableRowHeight, rh);
                
                spaceToDistribute -= layoutItem.actualSize.y;
            } 
        }
        
        if (totalCount > 1)
            spaceToDistribute -= (totalCount-1) * gap;

        // Distribute the extra space among the flexible children
        if (totalPercentHeight)
