Since fontSharpness and fontThickness don’t work in Flex 4, as it says here (though I’d like to be proven wrong), I have replaced every <s:Label/> in my application with <mx:Label/>.
Though it works well in panels and dialogs, it doesn’t work in skins.
When I add skin parts to skins, they should extend a predefined class.
Say for promptDisplay in TextInputSkin I cannot use this:
<mx:Label id="promptDisplay"/>
where this:
<s:Label id="promptDisplay"/>
is supposed to be, because promptDisplay should extend an IDisplayText.
What is the best workaround for this?
Well, I suppose the quickest workaround would be to create your own Label class by subclassing mx
Labeland implementingIDisplayText. Something like this:Now you can use
MyLabelwherever anIDisplayTextis required and applyfontSharpnessandfontThicknessto it, since those two styles are inherited.Be warned though that this will not work if a
TextBaseis required.