# Switch component skins

**URL:** <https://forum.kirupa.com/t/switch-component-skins/235077>\
**Category:** Uncategorized\
**Created:** [August 8, 2007, 8:41am UTC](https://forum.kirupa.com/t/switch-component-skins/235077 "2007-08-08T08:41:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Huinoio](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@Huinoio](https://forum.kirupa.com/u/Huinoio)\
**Post date:** [August 8, 2007, 8:41am UTC](https://forum.kirupa.com/t/switch-component-skins/235077/1 "2007-08-08T08:41:26Z")

</div>

When creating a custom component and using the flashbrighton tutorial, I end up with a skin I can reference with the following code within the draw function:  
[SIZE=1]protected override function draw():void {  
var classDef:Object;  
if (main\_mc == null) {  
try {  
classDef=this.loaderInfo.applicationDomain.getDefinition(“Skin1”);  
} catch (e:ReferenceError) {  
trace(e);  
return;  
}  
main\_mc=new classDef as MovieClip;  
}  
addChildAt(main\_mc,0);  
//main\_mc.width = width;  
//main\_mc.height = height;  
}[/SIZE]  
[SIZE=1][/SIZE]  
My question is how do I set up other skins to use for custom events? Say I need to change from “onskin” to “offskin” for a custom light component. Do I have to detroy the child a main\_mc,0 and create the other each time I switch? I still can’t find any good documentation for these components. I am thinking it might be a style problem for fast switching. Maybe like the button over and disabled stuff?
