Hello,
I want to generate a button sequence on ButtonBar with some disabled buttons:
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var nav:ArrayCollection=new ArrayCollection();
...
function initApp():void
{
nav.removeAll();
for(var i:uint=0;i<navSize;i++)
{
nav.addItem({label: i });
}
nav.addItem({label: "Last", enabled:false});
}
]]>
</mx:Script>
...
<mx:ButtonBar id="btnBar" dataProvider="{nav}"/>
but why the last button is still enabled?
UPD: I found solution by adding updateComple event handler:
function upd()
{
trace("upd()");
for (var i:int=0; i < btnBar.numChildren; i++)
{
if ([condition])
{
Button(btnBar.getChildAt(i)).enabled=false;
}
}
}
Anybody have better solution?