Flex: Apply Styles By Composition?
I have an HBox based component that has multiple shortcuts in it. I want to be able to set all style properties on my component like fontSize, fontWeight, color, etc. And apply them to all the labels it contains. What's the best approach for this? I tried to implement my Label component but there is no Label interface.
Thanks.
PS Not sure what would be a good title for this question, so feel free to edit it if you have something better.
+1
a source to share
2 answers
Two options I can think of:
- You can provide a default stylesheet (default.css) with your component, and use custom styles for Label.fontSize, Label.fontWeight, etc. that will spread all over the place.
- You can extend the Label to create a custom component and define the default styles in it. Then use your custom shortcut in your custom component.
Check out this documentation for more information:
http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_8.html
0
a source to share