 {
 
 import mx.core.ILayoutElement;
+import mx.core.IUIComponent;
 import mx.core.ScrollPolicy;
 
 import spark.components.Scroller;

    private function getScroller():Scroller
    {
        var g:Skin = target as Skin;
        
        return (g && ("hostComponent" in g)) ? Object(g).hostComponent as Scroller : null;
    }
    

        var scroller:Scroller = getScroller();
        if (!scroller) 
            return;

        var viewport:IViewport = scroller.viewport;
        var hsb:ScrollBar = scroller.horizontalScrollBar;
        var vsb:ScrollBar = scroller.verticalScrollBar;
        var minViewportInset:Number = scroller.minViewportInset;
        
        // If the viewport's size has been explicitly set (not typical) then use it 
        var viewportUIC:IUIComponent = viewport as IUIComponent;
        var explicitViewportW:Number = viewportUIC ? viewportUIC.explicitWidth : NaN;
        var explicitViewportH:Number = viewportUIC ? viewportUIC.explicitHeight : NaN;
        
        // Decide which scrollbars will be visible based on the viewport's content size
        var showHSB:Boolean = false;
