Copy link to clipboard
Copied
Maybe its just me, but I have been a flex designer/developer for over 3 years. I always found the CSS way of styling components to be very straightforward and easy to use. FLex 4 is such a step back I wish adobe would rethink this whole thing. I have spent an enormous amount of time trying to get somewhere with our large enterprise app and it is so much more work to style. As an example buttons. Do we really need a different skin for every single button we want to add an icon too? According to any examples I have seen this is the case. Why? That makes no sense whatsoever. I probably have 70-80 buttons with different icons so I need to create 70-80 different skins? The old way setting image=source as a property made MUCH more sense. Buttons can no longer have a two tone gradient? Not unless you create skins. This is just one example. I am just finding it VERY frustrating to get the look and feel i want.
Copy link to clipboard
Copied
You can accomplish this with a single skin. I did some google searches and found a few ways to do it. Here's one approach:
1) Subclass button and add an icon property to it:
2) In your skin add the following to reference the icon property:
<!-- layer 2: icon -->
<s:Graphic id="icon"
<s:BitmapImage source="{hostComponent.data.icon}"/>
</s:Graphic>