 
         unloadingSkin();
         clearSkinParts();
-        removeChild(skinObject);
-        _skinObject = null;
+        removeChild(skin);
+        setSkin(null);
     }
 
     //--------------------------------------------------------------------------

                
                if (part.required)
                {
                    if (!(part.id in skinObject))
                        throw(new Error("Required skin part \"" + part.id + "\" cannot be found.")); 
                }
                
                if (part.id in skinObject)
                {
                    this[part.id] = skinObject[part.id];
                    
                    // If the assigned part has already been instantiated, call partAdded() here,
                    // but only for static parts.

    {
        var allStyles:Boolean = styleProp == null || styleProp == "styleName";
        
        if (allStyles || styleProp == "skinClass" || styleProp == "skinFactory")
        {
            skinChanged = true;
            invalidateProperties();
