Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible to pass parameters to a skin?

I have 2 skins, almost identical, but differ in 1 small way that can be accounted for if I could pass a Boolean to the skin while assigning it to the host component (a button).

<s:Button skinClass="MyBtnSkin" />

Is there a way while assigning the skin to the button, I could also pass a parameter to the skin somehow?

like image 450
nick Avatar asked Apr 04 '10 12:04

nick


1 Answers

You have to create a Button subclass and add your custom boolean property in it.

<s:MyCustomButton skinClass"MyBtnSkin" customProperty="true" />

Updating your skin file when customProperty changes could be done with binding afterwards.

<Rect ... visible={hostComponent.customProperty}>
like image 178
Florian F Avatar answered Oct 21 '22 02:10

Florian F