 package flex.layout
 {
 
+import flash.geom.Rectangle;
+
 import flex.core.Group;
 import flex.intf.ILayout;
 import flex.intf.ILayoutItem;
 
 import mx.containers.utilityClasses.Flex;
+
 
 /**
  *  Documentation is not currently available.

        }
        return spaceToDistribute;
    }


    /*
    public function fill(unscaledWidth:Number, unscaledHeight:Number):void
    {
        var maxWidth:Number = 0;
        var maxHeight:Number = 0;
        var vTarget:VirtualizedContainer = _target as VirtualizedContainer;

        if (!vTarget)
            return;
            
        var index:Number = vTarget.firstVisibleChildIndex;
        
        while (maxHeight < unscaledHeight)
        {
            var child:DisplayObject = vTarget.getOrCreateChildSkin(index++);
            
            if (!child)
                break;
                
            var fdoChild:IFlexDisplayObject = child as IFlexDisplayObject;
            var uicChild:IUIComponent = child as IUIComponent;
            if((fdoChild as UIComponent == null) || UIComponent(fdoChild).includeInLayout)
            {
                if (child is UIComponent)
                    UIComponent(child).validateNow();
                    
                var childWidth:Number = uicChild ? uicChild.getExplicitOrMeasuredWidth() : fdoChild ? Math.max(fdoChild.measuredWidth, 0) : child.width;
                var childHeight:Number = uicChild ? uicChild.getExplicitOrMeasuredHeight() : fdoChild ? Math.max(fdoChild.measuredHeight, 0) : child.height;
                
                maxWidth = Math.max(maxWidth, childWidth);
                maxHeight += childHeight + GAP;
            }
        }
    }
    
    public function get maxHScrollPosition():Number
    {
        return 0;
    }
    
    public function get maxVScrollPosition():Number
    {
        var targetVirtualizedContainer:VirtualizedContainer = _target as VirtualizedContainer;
        
        if (targetVirtualizedContainer)
            return targetVirtualizedContainer.children.length - target.numChildren;
        else
            return target.numChildren;
    }
    
    public function get horizontalPageSize():Number
    {
        return 0;
    }
    
    public function get verticalPageSize():Number
    {
        // Should calculate this somehow....
        return 10;
    }
    
    public function scrollPositionToChildIndex(hScrollPosition:Number, vScrollPosition:Number):Number
    {
        // For vertical layout, vertical scroll position == child index
        return vScrollPosition;
    }
    */
}
}



            lo.setActualPosition(x, y);
            y += lo.actualSize.y;
            y += gap;
        }
        
        var r:Rectangle = layoutTarget.scrollRect; // returns a copy
        if (r != null) 
        {
            r.width = unscaledWidth;
            r.height = unscaledHeight;
            layoutTarget.scrollRect = r;
        }
        else 
        {
        	var rx:Number = layoutTarget.horizontalScrollPosition;
        	var ry:Number = layoutTarget.verticalScrollPosition;
        	layoutTarget.scrollRect = new Rectangle(rx, ry, unscaledWidth, unscaledHeight);
        }
    }
    
    
    /**
     *  This function sets the height of each child
     *  so that the heights add up to <code>height</code>. 
