RadioButtonBar

For a long time using Flex 3 I was always happy using mx:RadioButton along with mx:RadioButtonGroup. Some time back it dawned on me that I generally lay these buttons out in some formal layout, either horizontally, vertically or tiled, and that it would be easier to drive them via data, the selected data item being passed to a service at some point.

With this conclusion I thought I could just create a st:RadioButtonItemRenderer by extending s:RadioButton and implementing s:IItemRenderer to use it in a s:ButtonBar, which would have all the qualities of a s:RadioButtonGroup. This is all that is really required to create a group of buttons that each act and look like a set radio buttons where only 1 can be selected, but for ease of use I also added a st:RadioButtonBar and st:RadioButtonBarSkin.


(right click for source).

The source can be downloaded from our Google Code repository, the following classes have been added.

  • ws.tink.spark.controls.RadioButtonBar
  • ws.tink.spark.skins.controls.RadioButtonBarSkin
  • ws.tink.spark.itemRenderers.RadioButtonItemRenderer
  • One Response to “RadioButtonBar”

    Leave a Reply