Search Flex Samples

Setting the data provider of a Flex ButtonBar control to a ViewStack container

The following example shows how you can set the data provider of a ButtonBar control in Flex to a ViewStack container.

Full code after the jump.






View MXML



<mx:application mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalalign="middle" backgroundcolor="white">


<mx:buttonbar id="buttonBar" dataprovider="{viewStack}" buttonheight="32">


<mx:viewstack id="viewStack">

<mx:vbox label="Button" icon="@Embed('assets/Button.png')" backgroundcolor="white" width="480" height="60">

<mx:label text="Button...">

</mx:label>

<mx:vbox label="ButtonBar" icon="@Embed('assets/ButtonBar.png')" backgroundcolor="white" width="480" height="60">

<mx:label text="ButtonBar...">

</mx:label>

<mx:vbox label="CheckBox" icon="@Embed('assets/CheckBox.png')" backgroundcolor="white" width="480" height="60">

<mx:label text="CheckBox...">

</mx:label>

<mx:vbox label="ColorPicker" icon="@Embed('assets/ColorPicker.png')" backgroundcolor="white" width="480" height="60">

<mx:label text="ColorPicker...">

</mx:label>

</mx:vbox>


</mx:vbox>

View source is enabled in the following example.


</mx:vbox></mx:vbox></mx:viewstack></mx:buttonbar></mx:application>

0 comments:

Related Flex Samples

Learn Flex: Flex Samples | Flex Video Tutorials Flex Examples