Category Archives: ButtonBar

Changing the label placement on an MX ButtonBar control in Flex (redux)

In a previous example, “Changing the label placement for a Flex ButtonBar control”, we saw how you could change the button’s label placement relative to its icon in a ButtonBar control in Flex by using the getChildAt() method and labelPlacement property.

The following example shows how you can set the label/icon placement on an MX ButtonBar control in Flex by extending the MX ButtonBar class and setting the navItemFactory property in the mx_internal namespace to a custom class.

Continue reading Changing the label placement on an MX ButtonBar control in Flex (redux)

Setting an image background on a Halo ButtonBar control in Flex 4

The following example shows how you can set an image background on a Halo ButtonBar control (with default Spark skin) in Flex 4 by setting the buttonStyleName, firstButtonStyleName, lastButtonStyleName, and skin styles.

Full code after the jump.

Continue reading Setting an image background on a Halo ButtonBar control in Flex 4

Determining which button was pressed in a Flex ButtonBar component

The following example shows how you can determine which button was pressed in a ButtonBar control in Flex by listening for the itemClick event. You can then use the item, index, or label attribute in the ItemClickEvent object to find out which button was clicked.

Full code after the jump.

Continue reading Determining which button was pressed in a Flex ButtonBar component