0

I have disabled toggling in button bar. this works fine. However previously selected button bar remains selected.

Here is the code:

if(event.newIndex == -1) {

ButtonBarButton(event.target.dataGroup.getElementAt(event.oldIndex)).selected = true;
}

Here is the steps to reproduce issue

1) Click on any button in the button bar

2) clicked button becomes highlighted

3) Agains click on same button, it becomes highlighted

4)Now, you click on other button, both previous button and newly selected button becomes highlighted

Please advice,

thanks,

ketan
  • 19,129
  • 42
  • 60
  • 98
flex
  • 185
  • 5
  • 19

1 Answers1

0

What exactly are you trying to do and how did you disable toggling in the button bar? I would venture to guess that what ever you did to disable toggling (not seeing a native property for that) is coming around to bite you. Try this:

for(var i:int = 0; i < event.target.parent.numElements; i++)
{
    event.target.parent.getElementAt(i).selected == false
}
event.target.enabled == true;

This should get the parent of the button clicked (the button bar) and ensure that all its children (the buttons) are not enabled. Then go back and enable the target that the user clicked on in the first place.

Dom
  • 2,569
  • 1
  • 18
  • 28