Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 966601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:10:59+00:00 2026-05-16T02:10:59+00:00

Hi I want to create a flex web page. Basically I have some menubaritems

  • 0

Hi I want to create a flex web page. Basically I have some menubaritems at the top and when I click at one of the dropdowns from the menubar, the component would change to a page with different content.

How do I go about this?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T02:11:00+00:00Added an answer on May 16, 2026 at 2:11 am

    Sounds to me like the exact component you’re after is the TabNavigator (Adobe docs).

    It’s fairly simple to use. Each child of the the TabNavigator component represents a tab page of content (note that children must be containers such as Canvas or VBox), and the label property of the child is used to represent the label on the tab itself.

    A very simple web site using tabs might look something like:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute" width="100%" height="100%" pageTitle="My Website" />
        <mx:TabNavigator width="100%" height="100%">
            <mx:VBox width="100%" height="100%" label="Standard Page">
                <mx:Label text="Standard Page Title" fontWeight="bold"/>
                <mx:Text  width="100%" height="100%"
                    text="Here is some page content." />
            </mx:VBox>
    
            <mx:VBox width="100%" height="100%" label="Image Gallery">
                <mx:Label text="Image Gallery Title" fontWeight="bold" />
                <mx:TileList width="100%" height="100%">
                    <mx:Image source="my_image1.png" />
                    <mx:Image source="my_image2.png" />
                    <mx:Image source="my_image3.png" />
                    <mx:Image source="my_image4.png" />
                </mx:TileList>
            </mx:VBox>
        </mx:TabNavigator>
    </mx:Application>
    

    You can stack as many child container components within the TabNavigator as you like, and their contents will (by default) only be loaded when you select the relevant tab.

    If you can be a little more specific about what you’re trying to build, there’s probably a few more tricks for you out there too. Hopefully this gives you a start though.

    EDIT: Okay, if you’re using dropdown menus instead, it’s the same concept but a little more manual labour is involved.

    The TabNavigator component uses a ViewStack component (Adobe docs), which is basically a stack of content pages where only one is shown at a time (determined by the stack’s selectedIndex property), with a TabBar component to control the selected index. What you want to do is still use that same ViewStack to hold all your pages, but you want a dropdown menu item selection to change the selectedIndex for you.

    A MenuBar component (Adobe docs) provides the dropdown items, generated from an XMLListCollection data provider. To handle item selections, set an itemClick event handler to the MenuBar, and set the ViewStack’s selectedIndex property based on which menu item was selected.

    Something like this should give you a start, and hopefully the comments help explain it. From there you can add pages, MenuBar items, etc.

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
        <mx:Script>
            <![CDATA[
                import mx.events.MenuEvent;
    
                /**
                 * Handle the selection of a menu item.
                 */
                private function menuItemClickHandler(event:MenuEvent):void
                {
                    // Get the submenuitem node that was clicked
                    var selection:XML = XML(event.item);
                    // Depending on the label of the item that was clicked,
                    // modify the selectedIndex property of the content ViewStack
                    switch(selection.@label.toString())
                    {
                    case "Page 1":
                        pageStack.selectedIndex = 0;
                        break;
    
                    case "Page 2":
                        pageStack.selectedIndex = 1;
                        break
                    }
                }
            ]]>
        </mx:Script>
    
        <!-- Data provider collection for the menu bar -->
        <mx:XMLListCollection id="menuXLC">
            <mx:source>
                <mx:XMLList>
                    <menuitem label="Content">
                        <submenuitem label="Page 1" />
                        <submenuitem label="Page 2" />
                    </menuitem>
                </mx:XMLList>
            </mx:source>
        </mx:XMLListCollection>
    
        <!-- MenuBar to provide dropdown items -->
        <mx:MenuBar dataProvider="{menuXLC}" width="100%"
            labelField="@label"
            itemClick="menuItemClickHandler(event)" />
    
        <!-- ViewStack containing the various content pages -->
        <mx:ViewStack id="pageStack" width="100%" height="100%">
            <!-- Each of these child components represents a separate page of content.
                 You should really define them in separate components. -->
            <mx:VBox id="contentPageOne" label="First Page" width="100%" height="100%">
                <mx:Label text="First Page Title" />
                <mx:Text text="First Page content." />
            </mx:VBox>
    
            <mx:VBox id="contentPageTwo" label="Second Page" width="100%" height="100%">
                <mx:Label text="Second Page Title" />
                <mx:Text text="Second Page content." />
            </mx:VBox>
        </mx:ViewStack>
    </mx:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.