         super();
     }
     
+    private var numColsInRow:Array;
+    
     //--------------------------------------------------------------------------
     //
     //  Properties

        var numRows:int = Math.ceil(numItems / requestedMaxColumnCount);
        var numColumns:int = Math.ceil(numItems / numRows);
        // Calculate the number of empty spots by getting the inverse of the column mod
        var emptySpots:int = (numItems % numColumns) > 0 ? numColumns - numItems % numColumns : 0;
        // Figure out whether the first row has more or fewer items. Default is fewer.
        var useMaxColumns:Boolean = (numRows % 2 == 1) ? Math.floor(numRows / 2) == emptySpots: false;        
        
        for (var rowIndex:int = 0; rowIndex < numRows; rowIndex++)
        {    
            var currentRowColumns:int = (emptySpots > 0) && !useMaxColumns ? numColumns - 1 : numColumns;
            var viewWidth:Number = width - (currentRowColumns - 1) * horizontalGap;
            var w:Number = itemW = Math.floor(viewWidth / currentRowColumns);
            // Keep track of the extra pixels since we round off the item widths
            extraWidth = Math.round(viewWidth - w * currentRowColumns);
            

        if (!layoutTarget)
            return;
        
        numColsInRow = [];
        
        var xPos:Number = 0;
        var yPos:Number = 0;
        var itemIndex:int = 0;
