Change the enabled property for two Button controls, setting one false, and the other true
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:states>
<mx:State name="NewButton">
<mx:AddChild relativeTo="{v1}">
<mx:Button id="b3" label="New Button" />
</mx:AddChild>
<mx:SetProperty target="{b1}" name="enabled" value="false" />
<mx:SetProperty target="{b2}" name="enabled" value="true" />
</mx:State>
</mx:states>
<mx:VBox id="v1">
<mx:Button id="b1" />
<mx:Button id="b2" enabled="false" />
<mx:Button label="Change to NewButton state" click="currentState = 'NewButton';" />
<mx:Button label="Change to base view state" click="currentState = '';" />
</mx:VBox>
</mx:Application>
Related examples in the same category