How to set runtime skin in Flex 4

I have a set of custom controls based on SkinnableContainer.

When adding a control during development, I can specify the skin using the skinClass attribute in the tag.

I need to add some of these elements at runtime, and I cannot figure out how to specify skinClass for my controls.

eg.

var something:CustomThing = new CustomThing();

/* mistery code here to attach the skin ? */

addElement(something);

How to do it?

Thank!

+5
source share
1 answer

mmmmm, found this actually .. need to set the style ..

something.setStyle("skinClass", MySomethingSkinClass);
+20
source

All Articles