[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

03/27/2009 at 02:09PM PDT, ID: 24272691 | Points: 500
[x]
Attachment Details

I want to add links to the flex menubar

Asked by montu_12 in Adobe Flex

Tags: Flex Menubar links

Hi guys, I am very new to flex and action script, I have this menubar and want to add links in to it. I used itemclick but it only works for the submenu and does not work for the menuItem, Can you guys please help me get the solution to this problem?

for example - when i click on the top level menuitem or submenu item - we should be able to go to google.com or adobe.com

Appreciate it,
Thanks,

this is wt i have so far


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
<?xml version="1.0"?>
<!-- Simple example to demonstrate the MenuBar control. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initCollections();" >
 
    <mx:Script>
        <![CDATA[
 
            import mx.events.MenuEvent;
            import mx.controls.Alert;
            import mx.collections.*;
 
            [Bindable]
            public var menuBarCollection:XMLListCollection;
    
            private var menubarXML:XMLList =
                <>
                    <menuitem label="Menu1" data="top">
                        <menuitem label="MenuItem 1-A" data="1A"/>
                        <menuitem label="MenuItem 1-B" data="1B"/>
                    </menuitem>
                    <menuitem label="Menu2" data="top">
                        <menuitem label="MenuItem 2-A" type="check"  data="2A"/>
                        <menuitem type="separator"/>
                        <menuitem label="MenuItem 2-B" >
                            <menuitem label="SubMenuItem 3-A" type="radio"
                                groupName="one" data="3A"/>
                            <menuitem label="SubMenuItem 3-B" type="radio"
                                groupName="one" data="3B"/>
                        </menuitem>
                    </menuitem>
                </>;
 
            // Event handler to initialize the MenuBar control.
            private function initCollections():void {
                menuBarCollection = new XMLListCollection(menubarXML);
            }
 
            // Event handler for the MenuBar control's itemClick event.
            private function menuHandler(event:MenuEvent):void  {
                // Don't open the Alert for a menu bar item that 
                // opens a popup submenu.
                if (event.item.@data != "top") {
                    Alert.show("Label: " + event.item.@label + "\n" + 
                        "Data: " + event.item.@data, "Clicked menu item");
                }        
            }
         ]]>
    </mx:Script>
 
    <mx:Panel title="MenuBar Control Example" height="75%" width="75%" 
        paddingTop="10" paddingLeft="10">
 
        <mx:Label width="100%" color="blue"
           text="Select a menu item."/>
 
        <mx:MenuBar labelField="@label" itemClick="menuHandler(event);" 
            dataProvider="{menuBarCollection}" />
            
    </mx:Panel>
</mx:Application>
[+][-]03/28/09 08:05 AM, ID: 24008758

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/28/09 02:24 PM, ID: 24010256

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/29/09 06:18 AM, ID: 24012577

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/29/09 10:10 AM, ID: 24013491

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/30/09 01:31 AM, ID: 24016881

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/04/09 02:00 PM, ID: 24778003

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_FREE_TRIAL_20090127