Creating stylable button skins for Flex 4′s new Spark Components isn’t that different from creating stylable skins in Flex 3. Sure you have your skin parts and the whole new way of writing skins, but the basic functionality for handling detecting style changes remains the same. In this demo, I’ve created a Spark Button that has a custom skin applied. The custom’s skin’s properties are set via CSS (making it stylable), and therefore making it possible to use the same button skin in multiple ways, say for a button with a larger font size and a smaller font size, or a purple button and a green button.
I should note that most the styles I defined for this button are ones we’re used to seeing from Flex 3 ‘fillColors’ and ‘cornerRadius’ but really we can define any sort of style property we’d like, for example, I defined a labelStyleName style since I like to define my text styles separately.
(as usual, right click to view source)