         for (; (y < maxVisibleY) && (index < eltCount); index++)
         {
             var elt:ILayoutElement = layoutTarget.getLayoutElementAt(index);
-            var h:Number = elt.getPreferredBoundsWidth();
+            var h:Number = elt.getPreferredBoundsHeight();
             var w:Number = calculateElementWidth(elt, targetWidth, contentWidth);
             var x:Number = calculateElementX(elt, w, contentWidth);
             elt.setLayoutBoundsPosition(x, y);
-            elt.setLayoutBoundsSize(w, elt.getPreferredBoundsWidth());            
+            elt.setLayoutBoundsSize(w, elt.getPreferredBoundsHeight());            
             llv.cacheDimensions(index, elt);
             y += h + gap;
         }

        else if (!target || (target.numLayoutElements <= 0))
            return 0;
        else if (typicalLayoutElement)
            return typicalLayoutElement.getPreferredBoundsWidth();
        else
            return target.getLayoutElementAt(0).getPreferredBoundsWidth();
    }

    /**

            }            

            preferredWidth = Math.max(preferredWidth, li.getPreferredBoundsWidth());
            preferredHeight += li.getPreferredBoundsHeight(); 
            
            var vrr:Boolean = (reqRows != -1) && (visibleRows < reqRows);

            if (vrr || (reqRows == -1))
            {
                var mw:Number =  hasPercentWidth(li) ? li.getMinBoundsWidth() : li.getPreferredBoundsWidth();
                var mh:Number = hasPercentHeight(li) ? li.getMinBoundsHeight() : li.getPreferredBoundsHeight();                   
                minWidth = Math.max(mw, minWidth);
                minHeight += mh;
            }
