0
votes

I have a ButtonBar w/ a series of buttons that will each have a custom label:

  1. Person's name (fontsize 18)
  2. Person's address (fontsize 12)

I am using Flex 4 w/ a custom-skinned spark buttonbar.

I've got the following but how do I now change the fontsizes? Do I change this label function or is that somehow controlled in the spark skin?

'

  protected function customLabel(item:Object):String {
    return item.name+ "\n" + item.address;
}

'

1
I guess another option would be to have 2 different labels: 1 w/ the person's name & a second w/ their address. I have no idea where to even start w/ that, though.kristen

1 Answers

1
votes

A labelFunction's purpose is to return a string that can be used by the component as a display string for the item in question. labelFunction has no relation to how the data is displayed.

I did not believe any Flex Components support different fontsizes. I would look into creating your own custom component that uses two separate labels; one for each font size. You can probably extend the Button class easy enough to make this happen, adding a new skin part and create a custom skin class that deal with the font sizes and positioning.