 import flash.display.DisplayObject;
 import flash.events.Event;
 import flash.geom.Point;
-import flash.system.ApplicationDomain;
 import flash.utils.*;
 
-import spark.components.supportClasses.Skin;
 import mx.core.ClassFactory;
 import mx.core.IFactory;
-import mx.core.IFlexModuleFactory;
 import mx.core.IInvalidating;
 import mx.core.ILayoutElement;
 import mx.core.IVisualElement;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 import mx.events.PropertyChangeEvent;
-import mx.managers.ISystemManager;
-import mx.modules.ModuleManager;
 
 //--------------------------------------
 //  Styles

     */
    protected function clearSkinParts():void
    {
        var className:String = getQualifiedClassName(this);
        var parts:Array = getSkinPartMetadata(className);
        
        if (parts)
        {
            for (var i:int = 0; i < parts.length; i++)
            {
                var skinPart:SkinPartInfo = parts[i];
                var skinPartID:String = skinPart.id;
                
                if (this[skinPartID] != null)
                {
                if (!(this[skinPartID] is IFactory))
                {
                    partRemoved(skinPartID, this[skinPartID]);
                }
                else
                {
                    var len:int = numDynamicParts(skinPartID);
                    for (var j:int = 0; j < len; j++)
                        removeDynamicPartInstance(skinPartID, getDynamicPartAt(skinPartID, j));
                }
            }
                this[skinPartID] = null;
            }
        }
    }

     */
    private function skin_propertyChangeHandler(event:PropertyChangeEvent):void
    {
        if (skinParts)
        {
            var skinPartID:String = event.property as String;
            if(skinParts[skinPartID] != null)
            {
                this[skinPartID] = event.newValue;
                
                if (!(this[skinPartID] is IFactory))
                    partAdded(skinPartID, this[skinPartID]);
            }
        }
    }
