Flex Problem Enabling and Disabling Button in List

Posted by pfunc on Stack Overflow See other posts from Stack Overflow or by pfunc
Published on 2010-04-15T18:08:38Z Indexed on 2010/04/16 6:13 UTC
Read the original article Hit count: 214

Filed under:

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?

© Stack Overflow or respective owner

Related posts about flex