开发者

How to set skin at runtime in Flex 4

开发者 https://www.devze.com 2022-12-30 12:36 出处:网络
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 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 s开发者_C百科pecify 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!


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

something.setStyle("skinClass", MySomethingSkinClass);
0

精彩评论

暂无评论...
验证码 换一张
取 消