Flex Problem Enabling and Disabling Button in List
- by pfunc
I have a list with a dataprovider, it lists out buttons encapsulated in an item renderer. All I want it to do is have a skin that it changes to when it is clicked. I can get this to happen, but then it just goes back to its up state. I want it to stick on the down state, which I have to do by disabling the button.
So I tried this:
buttonList.selectedItem.enabled = false;
for(var i:Number = 0; i< buttonList.numChildren; i++)
{
var loopBtn = buttonList.getChildAt(i);
if(loopBtn != buttonList.selectedItem)
{
loopBtn.enabled = true;
}
}
But this doesn't seem to work. What am I doing wrong here?