A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to get MenuBar component item.

  1. #1
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977

    Unhappy How to get MenuBar component item.

    I played first time with this component.
    I can use it for a web menu.
    How can I get the Edit item?
    Assume that the text Edit could be like buton with name About us.
    I can get the menu items but the menubar not.

    Thanks

    Code:
    // MenuBar definition
    var my_mb : mx.controls.MenuBar;
    my_mb.setSize (940, 25)
    my_mb.move (5, 15)
    trace ('my_mb: ' + my_mb.getDepth ())
    //
    var myDP_xml : XML = new XML ();
    myDP_xml.ignoreWhite = true;
    myDP_xml.onLoad = function (success : Boolean)
    {
    	if (success)
    	{
    		my_mb.dataProvider = myDP_xml.firstChild;
    		trace (myDP_xml.toString ());
    	} else 
    	{
    		trace ("error loading XML file");
    	}
    };
    myDP_xml.load("http://www.flash-mx.com/mm/xml/menubar.xml");
    // set depth for MenuBar
    bg.setDepthBelow(my_mb);
    // Add a change-listener to Menu to detect which menu item is selected.
    var menuListener:Object = new Object();
    menuListener.change = function(evt_obj:Object) {
     var item_obj:Object = evt_obj.menuItem;
     trace("Item selected: "+item_obj.attributes.label);
    };
    my_mb.addEventListener("change", menuListener);
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    What exactly do you mean? The only thing you can do with the menubar is have dropdown menues.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Older Member jankratochvil's Avatar
    Join Date
    Nov 2001
    Location
    CZECH
    Posts
    977
    Yes I found this out.
    I think I can not trigger the MenuBar directly.
    I will solve it over the Button component and Menu component.
    I like all FLASH fans, but my girl can't stand them.
    -------------------------------------------
    I am still learning
    Sorry for my stupid questions (sometimes) and bad English.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center