Tag Archive for 'label'

25
Jun

Detecting when the label changes on a Button control in Flex

The following example shows how you can detect when a Flex Button control’s label changes using the labelChanged event.

Full code after the jump.

Continue reading ‘Detecting when the label changes on a Button control in Flex’

21
Mar

Customizing a FormItem container’s label in Flex 3

The following example shows how you can access the Label subcomponent in a Flex FormItem container and do fancy stuff like have form labels with hyperlinks or selectable text by using the itemLabel property.

Full code after the jump.

Continue reading ‘Customizing a FormItem container’s label in Flex 3′

08
Feb

Displaying tool tips in a Flex DataGrid control’s header

The following example shows you how you can truncate a DataGrid column’s text and display a tool tip by setting a custom header renderer.

Full code after the jump.

Continue reading ‘Displaying tool tips in a Flex DataGrid control’s header’

06
Feb

Truncating the label on a Flex CheckBox control

The following example shows how you can truncate the label on a CheckBox control in Flex by setting the width property.

Full code after the jump.

Continue reading ‘Truncating the label on a Flex CheckBox control’

27
Jan

Displaying a Label control’s text as a password

The following example shows you how you create a custom Label control in Flex that masks its text as a password by setting the Label control’s nested protected UITextField control’s displayAsPassword property.

Full code after the jump.

Continue reading ‘Displaying a Label control’s text as a password’

26
Jan

Truncating text in the Flex Label control using the truncateToFit property

The following example shows how you can use the truncateToFit property in the Label control in Flex to truncate strings if they exceed a specified width. The label control will terminate the string with “…” and allow you to roll over the text and read the entire (non-truncated) text in a tool tip, as seen in the following snippet:

<mx:Label text="The quick brown fox jumped over the lazy dog."
        truncateToFit="true"
        maxWidth="200" />

Full code after the jump.

Continue reading ‘Truncating text in the Flex Label control using the truncateToFit property’

26
Jan

Listening for the link event in a Flex Label control

The following example shows how you can use the link event with the Label control in Flex to handle hyperlinks embedded within a string of text. By using the “event:” prefix in the href property of an anchor (<a />) tag, you can handle links within your Flex application, use the ExternalInterface API to call JavaScript from Flex, or do pretty much whatever else you want.

Full code after the jump.

Continue reading ‘Listening for the link event in a Flex Label control’

09
Jan

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’

22
Sep

Truncating labels in a Flex ComboBox dropdown menu using an item renderer

The following example shows how you can use a Label control as an item renderer in a Flex ComboBox control so that items which exceed the combo box dropdown menu’s width are truncated with a nice “…”.

Full code after the jump

Continue reading ‘Truncating labels in a Flex ComboBox dropdown menu using an item renderer’

08
Aug

Positioning an icon within a button using the Button.labelPlacement property

Probably not too surprising to anybody, but you can easily control the location of an icon within a Button control by setting the button’s labelPlacement property.

Full code after the jump.

Continue reading ‘Positioning an icon within a button using the Button.labelPlacement property’