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

Resources

 

TabNavigator

  • The TabNavigator is essentially a ViewStack with TabBar control
  • Effects can be added to the TabNavigator's child containers to produce a smooth transition from one container to another. These effects can enhance the user's experience.
  • An effect is a visible or audible change that occurs over a period of time. e.g Fade, Blur, or Move
  • Use the hideEffect property of the child container being hidden and the showEffect property of the newly visible child container to apply effects
  • When switching to a new child container, the hideEffect will complete before the new container renders
  • Flex supports combined or composite effects
previous page next page

User rating?

Shopping.mxml

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

    <mx:Move id="hideEffect"
    	xTo="-500" />
    <mx:Move id="showEffect"
    	xFrom="500" />

    <mx:Panel width="500" height="300"
    	headerColors="[#000000,#FFFFFF]">

        <mx:TabNavigator id="viewstack2"
        	selectedIndex="0"
        	historyManagementEnabled="false"
        	width="100%" height="100%">

            <mx:Form label="Shopping Cart"
            	hideEffect="{hideEffect}" showEffect="{showEffect}">
                <mx:FormItem label="Acme Widget 1.0">
                    <mx:NumericStepper value="1" />
                    <mx:Button label="Add to Cart"
                    	click="viewstack2.selectedIndex=1" />
                </mx:FormItem>
            </mx:Form>

            <mx:Form label="Enter Your Payment Information"
            	hideEffect="{hideEffect}" showEffect="{showEffect}">
                <mx:FormItem label="Name on Credit Card">
                    <mx:TextInput />
                </mx:FormItem>
                <mx:FormItem label="Credit Card Number">
                    <mx:TextInput />
                    <mx:Button label="Buy"
                    	click="viewstack2.selectedIndex=2" />
                </mx:FormItem>
            </mx:Form>

            <mx:Form label="Thank You!"
            	hideEffect="{hideEffect}" showEffect="{showEffect}">
                <mx:Text text="Thanks for your purchase!" />
            </mx:Form>

        </mx:TabNavigator>

    </mx:Panel>
</mx:Application>

Rendered Example

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