0

How could i use percentage width for buttons at tooglebuttonbar, because i dont want to use the width property.

seismael
  • 227
  • 1
  • 6
  • 18

1 Answers1

2

To set percentage width of a component:

  1. In MXML, you can set the width property using a percentage value.

  2. In AS3, use the percentWidth property.

However, if you want to set the percentage width of buttons in a toggleButtonBar you can look at the buttonWidth style, but I suspect that doesn't accept percentages. If not, you're going to have to extend the component and re-write the updateDisplayList() method to size and position the buttons based on a percentage.

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
  • Hi, could you explain to me the hard part? how could i implement the percentage property for the button in the updateDisplayList if the button doesn't have this property? – seismael Aug 24 '10 at 12:41
  • Create a new component extending button bar. Add the property to your extended component "public var buttonWidthPercentage : int", just like you would create any other property. Then override updateDisplay list and calculate the button percentage width based on the unscaledWidth argument. – JeffryHouser Aug 24 '10 at 13:00