     override protected function detachSkin():void
     {    
         uninstallViewport();
-        skin.layout = null;
+        Group(skin).layout = null;
         skin.removeEventListener(MouseEvent.MOUSE_WHEEL, skin_mouseWheelHandler);
         super.detachSkin();
     }

import flash.text.TextField;
import flash.ui.Keyboard;

import spark.components.supportClasses.ScrollerLayout;
import spark.components.supportClasses.SkinnableComponent;
import spark.core.IViewport;
import mx.core.IVisualElement;
import mx.core.IVisualElementContainer;
import mx.core.ScrollPolicy;
import spark.core.NavigationUnit;
import mx.events.PropertyChangeEvent;
import mx.managers.IFocusManagerComponent;
import flash.display.InteractiveObject;

        if (skin && viewport)
        {
            viewport.clipAndEnableScrolling = false;
            Group(skin).removeElement(viewport);
            viewport.removeEventListener(PropertyChangeEvent.PROPERTY_CHANGE, viewport_propertyChangeHandler);
        }
    }
