Tag Archives: labelField

Changing the label placement on an MX TabBar control in Flex

In a previous example, “Changing the label placement on an MX ButtonBar control in Flex (redux)”, we saw how you could 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.

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

Continue reading Changing the label placement on an MX TabBar control in Flex

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)

Displaying icons in a Flex PopUpButton control (Redux)

In a previous example, “Displaying icons in a Flex PopUpButton control”, we saw how you could add icons to a PopUpButton control’s nested menu using an Array data provider.

The following example shows you how you can add icons to a pop up menu in a PopUpButton control in Flex by specifying the iconField property in the PopUpButton control’s nested Menu control using an XML data provider.

Full code after the jump.

Continue reading Displaying icons in a Flex PopUpButton control (Redux)

Exploding wedges in a Flex PieChart control based on user input

The following example shows how you can explode individual wedges in a PieChart when the user changes the value of a Slider control, or rolls over an item in a List control. For other examples of PieChart wedge exploding, check out “Exploding wedges in a Flex PieChart control”.

Full code after the jump.

Continue reading Exploding wedges in a Flex PieChart control based on user input

Specifying a custom label field on a Flex ComboBox control

The following example shows how you can specify a custom label field for a ComboBox control by using the ComboBox class’s labelField property.

The labelField property controls which field in the data provider will be used as the ComboBox item’s label. By default, the labelField property is “label”, although if you are using an XML data provider, you may want to change the labelField property to “@label”, or some other value.

Full code after the jump.

Continue reading Specifying a custom label field on a Flex ComboBox control

Displaying icons in a Flex List control

The following example demonstrates how to use embedded images in a List control so that each item in the list displays a little icon based on a certain property in the data provider. You’ll also notice that we set the textIndent style to give the label a bit more padding from the icon. Finally, we create three non-interactive Button controls beneath the list as a sort of “legend” for the icons.

Full code after the jump.

Continue reading Displaying icons in a Flex List control