Log In  
  Getting Started  
----------------------------------------

Resources

 

TabBar

  • A TabBar defines a vertical or horizontal row of tabs that control a ViewStack container
  • A LinkBar defines a vertical or horizontal row of links that control a ViewStack container
  • Bind the ViewStack id to the dataProvider property of the LinkBar or TabBar control
previous page next page

User rating?

TabBarDemo.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    backgroundColor="#FFFFFF"
    backgroundAlpha="0">

    <mx:Panel>
        <mx:TabBar dataProvider="{viewstack1}" />

        <mx:ViewStack id="viewstack1"
        	x="30" y="32"
        	width="452" height="339"
        	selectedIndex="0">
            <mx:Form label="Store"
            	width="100%" height="100%">
                <mx:FormItem label="Acme Widget 1.0">
                    <mx:NumericStepper id="num"
                    	value="1" />
                    <mx:Button label="Add to Cart"
                    	click="viewstack1.selectedIndex=1" />
                </mx:FormItem>
            </mx:Form>
             <mx:Form label="Shopping Cart"
             	width="100%" height="100%">
                <mx:FormItem label="Acme Widget 1.0">
                   <mx:Text text="Quantity: {num.value}" />
                   <mx:Text text="Total: ${num.value * 15.00}" />
                    <mx:Button label="Checkout"
                    	click="viewstack1.selectedIndex=2" />
                </mx:FormItem>
            </mx:Form>
            <mx:Form label="Checkout"
            	width="100%" height="100%">
                <mx:FormItem label="Name on Credit Card"
                	required="true">
                    <mx:TextInput id="ccname" />
                </mx:FormItem>
                <mx:FormItem label="Credit Card Number">
                    <mx:TextInput id="ccnum" />
                    <mx:Button id="buyButton"
                    	label="Buy" />
                </mx:FormItem>
            </mx:Form>
            <mx:Form label="Thank You!"
            	width="100%" height="100%">
                <mx:Text text="Thanks for your purchase!" />
            </mx:Form>
        </mx:ViewStack>
    </mx:Panel>

</mx:Application>

Rendered Sample

LinkBar

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    backgroundColor="#FFFFFF"
    backgroundAlpha="0">

    <mx:Panel>
        <mx:LinkBar dataProvider="{viewstack1}"/>

        <mx:ViewStack id="viewstack1"
        	x="30" y="32"
        	width="452" height="339"
        	selectedIndex="0">
            <mx:Form label="Store"
            	width="100%" height="100%">
                <mx:FormItem label="Acme Widget 1.0">
                    <mx:NumericStepper id="num"
                    	value="1" />
                    <mx:Button label="Add to Cart"
                    	click="viewstack1.selectedIndex=1" />
                </mx:FormItem>
            </mx:Form>
             <mx:Form label="Shopping Cart"
             	width="100%" height="100%">
                <mx:FormItem label="Acme Widget 1.0">
                   <mx:Text text="Quantity: {num.value}" />
                   <mx:Text text="Total: ${num.value * 15.00}" />
                    <mx:Button label="Checkout"
                    	click="viewstack1.selectedIndex=2" />
                </mx:FormItem>
            </mx:Form>
            <mx:Form label="Checkout"
            	width="100%" height="100%">
                <mx:FormItem label="Name on Credit Card" required="true">
                    <mx:TextInput id="ccname" />
                </mx:FormItem>
                <mx:FormItem label="Credit Card Number">
                    <mx:TextInput id="ccnum" />
                    <mx:Button id="buyButton"
                    	label="Buy" />
                </mx:FormItem>
            </mx:Form>
            <mx:Form label="Thank You!"
            	width="100%" height="100%">
                <mx:Text text="Thanks for your purchase!" />
            </mx:Form>
        </mx:ViewStack>

    </mx:Panel>

</mx:Application>

LinkBarDemo.mxml

previous page next page

Added by Mark Nichoson , last edited by matthew horn on Apr 22, 2008  (view change)
Labels: 
(None)

Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators