Search Flex Components Free

Custom Search

December 25, 2007

Flex Navigators Control ViewStack Source

Full Code Example:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundAlpha="0">

<mx:Script>
import mx.events.*;
</mx:Script>

<mx:Panel title="ViewStack Demo" width="100%" height="100%" borderAlpha="1">

<mx:ViewStack id="vs" width="100%" height="100%">

<mx:VBox label="View 1" width="100%" height="100%">
<mx:Label text="This is View 1" color="0xFF0000"/>
</mx:VBox>

<mx:VBox label="View 2" width="100%" height="100%">
<mx:Label text="This is View 2" color="0x0000FF"/>
</mx:VBox>

<mx:VBox label="View 3" width="100%" height="100%">
<mx:Label text="This is View 3" color="0x00AA00"/>
</mx:VBox>

</mx:ViewStack>

<mx:ControlBar>
<mx:ButtonBar itemClick="vs.selectedIndex = ItemClickEvent(event).index">
<mx:dataProvider>
<mx:String>View 1</mx:String>
<mx:String>View 2</mx:String>
<mx:String>View 3</mx:String>
</mx:dataProvider>
</mx:ButtonBar>
</mx:ControlBar>

</mx:Panel>

</mx:Application>

Related Flex Tutorials