Using the ViewStack with the TabBar, LinkBar

Notice the dataProvider attribute in the TabBar and LinkBar. The dataProvider in these two tags corresponds to the id of the ViewStack.

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

<mx:TabBar dataProvider="bookCategories" fontFamily="Tahoma"/>
<mx:ViewStack height="40%" width="25%" id="bookCategories">
	<mx:VBox backgroundColor="white" id="fiction" label="Fiction" fontFamily="Tahoma">
		<mx:Text width="800" textAlign="center" fontSize="36" text="Fiction" />
		<mx:Text textAlign="left" width="100%">
			<mx:htmlText>
				<![CDATA[
					...some html goes here...
				]]>
			</mx:htmlText>
		</mx:Text>
	</mx:VBox>

	<mx:VBox backgroundColor="white" id="nonfiction" label="NonFiction" fontFamily="Tahoma">
		<mx:Text width="800" textAlign="center" fontSize="36" text="Nonfiction" />
		<mx:Text textAlign="left" width="100%">
			<mx:htmlText>
				<![CDATA[
					...some html goes here...
				]]>
			</mx:htmlText>
		</mx:Text>
	</mx:VBox>
</mx:ViewStack>
<mx:LinkBar dataProvider="bookCategories" fontFamily="Tahoma"/>

</mx:Application>

 
 
 

Leave a Reply

You must be logged in to post a comment.