I am trying to programmatically skin a PopUpButton control in Flex Builder, but having no luck. As far as I know this requires writing a custom skin class or creating a modified version the control class itself (since the control is MX and not Spark). Again, just to clarify, I want to programmatically mod开发者_运维技巧ify the appearance not simply set styling properties or display an image. I've been able to do this programmatically with other MX controls (e.g. tabs in a tab navigator), but not with the PopUpButton.
I think part of the problem may be that the control is actually composed of two separate buttons, so you cannot draw just one rectangular area over the whole control. Does anyone know how to approach this?
Thanks for the help!
The solution I have settled on is using a custom MXML component that contains two spark buttons. There's a menu opening button (i.e. the button with the arrow) and a button to execute the most recent command selected from the menu. Each of these buttons has a custom skin.
Pressing the opening button shows an menu that is initially created in the component's "CreationComplete" routine. More on menus here: http://www.flexafterdark.com/docs/Flex-Menus (or since the page was down when I tried it: http://webcache.googleusercontent.com/search?q=cache:http://www.flexafterdark.com/docs/Flex-Menus)
You could also do this with a button and a dropdownlist inside a custom MXML component, but that didn't seem to work with the mult-level hierarchical XML I wanted to use in my dropdown menu.
If someone comes up with something better, please, please, do post it...
精彩评论