Yesterday I was working with the ToggleButtonBar in Flex and I wanted to change its appearance. I went over to the trusty Flex 3 style explorer and made some adjustments until I got it looking how I wanted. I copied the generated CSS, pasted it into my stylesheet and was ready to move on. When I ran my application however, I noticed that most of the styles had not taken effect. WTF?, I said. After some poking around and trying various configurations I came up with what I think is an acceptable solution.
When you copy the CSS from the style explorer you'll get something like this:
ToggleButtonBar { buttonHeight: 41; buttonWidth: 109; buttonStyleName: "mytoggleButtonBarButtonStyle"; firstButtonStyleName: "mytoggleButtonBarFirstButtonStyle"; lastButtonStyleName: "mytoggleButtonBarLastButtonStyle"; selectedButtonTextStyleName: "mytoggleButtonBarSelectedButtonStyle"; } .mytoggleButtonBarButtonStyle { highlightAlphas: 0, 0; fillAlphas: 1, 1, 1, 1; fillColors: #333333, #333333, #ff9900, #ff9900; color: #ffffff; textRollOverColor: #ffffff; textSelectedColor: #ffffff; themeColor: #0000cc; fontSize: 14; fontWeight: normal; } .mytoggleButtonBarFirstButtonStyle { cornerRadius: 9; } .mytoggleButtonBarLastButtonStyle { cornerRadius: 9; } .mytoggleButtonBarSelectedButtonStyle { color: #ffffff; fontSize: 14; fontWeight: normal; fontStyle: normal; textDecoration: none; }
What I found is you need to copy the styles from the .mytoggleButtonBarButtonStyle class to the other styles that are generated for you. Obviously keep in mind that you only want to copy the properties that are going to be the same for each state, otherwise you'll overwrite your changes. This worked for me, hope it helps.





