Could the style names for the various states of text colors on Buttons make less sense?
First off, kudos to the Flex Builder team for creating a remarkable framework. You guys/gals rock! 99.9 % of the time.
<rant>
With that being said, what the frak were you thinking about when you named the styles for the font colors on <Button> states? You started out good with the Embed skin names: upSkin, overSkin, pressSkin, disabledSkin. No problems there. All very self descriptive. Thank you.
However, to change the text color on a button for those 4 states is a bit tricky. First there’s color. That’s just the default color of the text in the up-state. The style name is a bit ambiguous don’t you think? Perhaps textColorUp would be more appropriate.
I don’t change the text colors for the hover and press states all the time so it’s easy to forget what they are. When I do look for them I look for, naturally, over and press text colors. But there aren’t any. This time the style names are perfectly descriptive textRollOverColor and textSelectedColor. The problem is that the skins are named by overSkin and pressSkin, respectively. One or the other would be just fine. I’d vote for textOverColor and textPressColor.
Besides, if I didn’t know any better I’d think that textSelectedColor was the color of the text when it is selected with the mouse.
Then we get to the last state: disabled. Or if you are more politically correct then call it the mousePressChallenged state. :) The style for this state is disabledColor. Which again begs the question: the color of what part of the button in the disabled state?
When I name properties I try to keep things grouped so that they all show up together in the code hinting and also so that if you find one of them you’ll know the other 3. I would name the styles as such:
- textColorUp
- textColorOver
- textColorPressed
- textColorDisabled
Then all anyone would have to do is type textC… and get the code hinting for all of the textColor states.
</rant>
At least now that I’ve bothered to blog about this I’m more likely to remember the cryptic styles names in the future. But then hopefully the style names will change in Gumbo and I won’t have to burden my feeble brain with these details.
If something here has proved valuable to you then feel free to drop a couple of bucks in the tip-jar.






