Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set skin at runtime in Flex 4

I have a bunch of custom controls based on a SkinnableContainer.

When adding the control at design time, I can specify a skin by using the skinClass attribute on the tag.

I need to add some of these elements during runtime, and I can't figure out how to specify the skinClass for my controls.

eg.

var something:CustomThing = new CustomThing();

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

addElement(something);

How do I do this?

Thanks!

like image 879
Ben Avatar asked May 12 '10 06:05

Ben


1 Answers

mmmmm, found it actually.. have to set a style..

something.setStyle("skinClass", MySomethingSkinClass);
like image 62
Ben Avatar answered Sep 19 '22 08:09

Ben