I've got a list and the selectedIndex doesn't seem to have any effect.
I posted this question on Stack Overflow, but I didn't get a reply.
I've got a panel with this list and a few radio buttons. I've set the defaults on the radio buttons, but I'm having problems setting 2010 as the default selection in the list.
<mx:List id="myList" width="120" height="80" alternatingItemColors="[0xFFFFFF, 0xEEEEEE]" selectedIndex="0"> <mx:dataProvider> <mx:Object label="2010" data="myData1" /> <mx:Object label="2009" data="myData2" /> <mx:Object label="2008" data="myData3" /> </mx:dataProvider> <mx:List>
Any suggestions? Thank you.
I tried adding: creationComplete="myList.selectedIndex=0". But, that didn't work, either.
Okay, I fiured it out. I was setting the selectedIndex in the component. But, I had another function acting on the instance, which was causing the problem. So, selectedIndex=0 was working fine.