Menu Bar with dataprovider in XML format

Good day!
Been working with flex for quite a while now and I must say it has been quite enjoyable. Unfortunately, I've stumbled upon a bit of a problem here and was hoping if someone could help me out. See I have this mxml which contains a menu bar, some containing sub menus while others do not.
The data provider for that menu bar is retrieved from a action script file lets say
menubar dataprovider = "{actionscriptfile.menubar}"
the menubar variable inside the acrtionscript file is in XMLLIstCollection format
ex. menuBarCollection = new XMLListCollection(XMLList(
'<menuitem label="Go to">' +
'<menuitem label="Home Page" />'
'</menuitem>'..etc..
This seems to be working just fine. However now, I want to serparate this actionscript from the menu items. I would like to place them inside an xml file which will be
used to populate the menuBarCollection.
I've tried using var request = new URLRequest("MenuXML.xml");
       var loader = new URLLoader();
       loader.load(request); <--inside the actionscript.
However nothing is being displayed inside the menu bar.
The xml file contains.
MenuXML.xml file
<?xml version="1.0" encoding="UTF-8"?>
<menuitem label="Go to">
<menuitem label="Home Page" />
</menuitem> 
Any help on how this can be done will be greatly appreciated.

I had the same problem.  I was debugging and saw that my data was there it was just a matter of HOW to get it out.  I am not sure if this is the correct way of doing it but after reading posts on how to use an XML file for the dataProvider for everything BUT a MenuBar this is what I came up with:
private function init():void
    var xml:XML;
    var urlRequest:URLRequest = new URLRequest("assets/menu.xml");
    var urlLoader:URLLoader = new URLLoader();
    urlLoader.dataFormat = URLLoaderDataFormat.TEXT;
    urlLoader.addEventListener(Event.COMPLETE, function (evt:Event):void
            xml = new XML(evt.target.data);
            menuBarCollection = new XMLListCollection(xml.children());
    urlLoader.load(urlRequest);
I put the event handler inline but it could be a separate function.  The part I was missing was ".children()".  I eventually found that in an ActionScript example of displaying data from an XML file in an AdvancedDataGrid.
Kevin

Similar Messages

  • Horizontal Spry Menu Bar with Horizontal Sub Menu

    I have created a horizontal menu bar with only one main menu item leading to a sub menu. I would like this sub menu to display horizontally also, instead of vertically as added by default.
    I am relatively new to dreamweaver and would appreciate any help possible.

    Came across the fix by accident thru extensions in menu bar,
    and choice of cursor for each section. Feeling happy! Happy New
    Year everyone.

  • The item in menu bar with the 3 rolling balls I used to download from You Tube are not on my tool bar since upgrading. How do I download now?

    There was an icon on the menu bar that had 3 balls that revolved. Next to it was a drop down arrow that would let me choose to download files from You Tube and others in several formats. I recently had to remove and reinstall Firefox from my computer and evidently with this version, that icon is not there. How do I get it back or how do I download now?

    If toolbar buttons aren't appearing then try http://kb.mozillazine.org/Corrupt_localstore.rdf
    For other problems with extensions, see "Corrupt extension files": http://kb.mozillazine.org/Unable_to_install_themes_or_extensions
    You may also need to reset some preferences created by that extension.<br />
    See http://kb.mozillazine.org/Resetting_preferences

  • How can you create a spry menu bar with no background colour?

    How can you create the first level of a spry menu bar to have no colour? I have a coloured background right now and the colour matches when you load the site in Internet explorer but does not match in Firefox. Any suggestions are welcomed on how to fix this.
    Thanks!
    HK

    Here is the site:
    http://partnersnaturally.ca/
    I am learning with code, (obviously) so any feedback would be nice. I use dreamweaver CS4, but when I originally designed the site it was in a much older version of dreamweaver. I wonder if that could also be a cause. (besides human error)
    Thanks again,
    HK

  • No more date in the Apple menu bar with OSX 10.5.6

    What is for me a glaring omission from both windows and Mac is the option to show the current date. The trick described at http://cybernetnews.com/2008/05/22/cybernotes-add-the-date-to-mac-menubar-clock/ however worked perfect. Until now... Unfortunately, it looks like with OSX 10.5.6 this no longer works. The behaviour when you have the date components in the time configured is odd: at first the top-right system menus seems to behave normal, eg when you click the airport option. But when you move the mouse down to select a menu item, the menu closes quickly on you and leaves the air tunes menu marked blue. Similar things happen with Time Machine and other system menus; rendering the top-right menu practically useless. Switching back (via Preferences to -in my case- Dutch system setting) will remove the date from the clock and restore the menu to normal behaviour.
    Does anybody know a nice little date utility for in the menu bar that works with 10.5.6 ? Thanks !

    I have no issues using the trick described in that method. Something is likely wrong with your system. It's also possible that the issue is specific to the Dutch localization.
    either way, try resetting your time display preferences
    enter the following terminal command
    rm ~/Library/Preferences/.GlobalPreferences.plist
    then log out/in. Your time display will be reset to the default. change it again using the method in that link.

  • Linking Menu Bar with views in the same window

    Hi everyone,
    I have a menu bar in a view and I would like to link each one of the elements with other view through an URL. The problem when I do this is that the view appears in a different window and I want that appears in the same window. Because if it doesn't, I'm going to have one window for each element of the menu bar :s
    Thanks in advance!

    Hi,
    As per my understanding, your requriement is: (Correct me if i am wrong).
    You have one default View and Window. In the View you are displaying the menu bar. Each menu bar item contails one specific URL. When user clicks on any of the menu bar item you need to open the corresponding URL in the same View.
    1)  Take the view set with two rows. In first row add the default MenuView (menu bar) and in second row embed another View (For example: ResultView).
    2). In RestultView create IFrame UI element (Note : it is deprecated). And bind one cotext attribute to url.
    Map this context attribute to MenuView also throug the Component Controller.
    3). Create inbound plug to MenuView and outbound plug to ResultView. On click on any of the menubar items change the URL in the context attribute and then navigate to the ResultView through plugs.
    Regards,
    Charan

  • Can't move around 3rd party apps in menu bar with Yosemite

    Hi - I have a Macbook Pro with Retina and I installed a few apps - pace, shazam, knock, flux and skip tunes. I wanted to edit the order of how they are displayed in the menu bar but I can't seem to be able to move them around (holding down the command key). However, this seems to be limited to the third party apps because I can move the native icons (bluetooth, battery, wireless) around just fine. Any help would be much appreciated. Thanks so much!

    I did the same this week. I did a sync and now I can't access any of my apps. They appear to open then shut right back down. Have tried to resync, update and about anything else that may fix and nothing. Paying an aweful lot of money just for texting and phone usage. Anyone know how to take care of this issue? I have a 3G phone and been using it for a year without this problem

  • Menu bar with Photoshop Elements 11

    The Menu bar at the top of my iMac will not disapear when I am using Photoshop E 11 and hide the PE11 control buttons. The usual key strokes etc don't work. I have tried uninstalling anr reinstalling but it still doesn't work.  Any suggestions?

    It appears that you have a Photoshop Elements question, but have posted to the Premiere Elements Forum (video editing).
    I will Move your post to the PsElements Forum.
    From a Photoshop perspective (I do not have PsElements, but only its "big brother"), PNG is a very common format, and Ps CS 6 (and all the way back to about version 5, IIRC), Opens them just fine.
    Can you Open those PNG files in say a viewer? I worry that they are corrupt.
    Still, in the PsE Forum, you will get great assistance.
    Good luck,
    Hunt

  • Menu Bar with no background on startup, just the black icons...!!!Help

    Sometimes when I start my Mac, the menu bar takes a while to appear. The Icons are there, and nothing else. If I click over it, it will appear.
    This has nothing to do with the transparent menu bar option.
    I can't find any info on the web...
    The only two things extra I have there are DropBox, and Bowtie for iTunes.
    Any ideias?
    Many Thanks

    I've heard that resetting PRAM can sort this issue out.
    http://docs.info.apple.com/article.html?path=Mac/10.6/en/26871.html

  • I am not able to view the default view of FF 4.0, It is showing menu bar with the windows border. When i turn off menu bar, the strip which should be present above the tabs goes missing.

    I have recently downloaded FF 4.0 and using a lot of add-ons. I am not able to view the default view of FF 4.0 with no menu bar. Even after turning off the menu bar from customization, I am able to see only the tabs and FF button, but not the strip over the tabs.

    When you hide the menu bar to display the Firefox button, the titlebar (strip above the tabs) is only displayed if the Firefox window is not maximized. If you always want the Window titlebar, you can use the Firefox 4 UI Fixer extension - https://addons.mozilla.org/firefox/addon/firefox-4-ui-fixer

  • Vertical Menu Bar with custom positioning

    I am working on a site that uses the very old mm_menu script. It is a PITA to maintain and modify. However, it allows on thing I have been unable to accomplish with Spry Vertical Menu -- the second level menus appear in the same vertical space as the first level menu. The normal operation for such menus is for the second level to start more or less with the vertical position of the first level button. But this means the second level often drops far below the bottom of the lowest first level button.
    Does anyone know of a way to customize where each second level appears (third and fourth are not needed)? Or some other UL/LI based menu code that can do this?

    Hi Bob,
    My first suggestion would be to re-order your navigation list to avoid the problem in the first place or figure out a different design altogether.  By re-ordering, I mean place menu items with the largest submenu at the top, and those with the smallest at the bottom.  Of course I understand there may be reasons not to do this, so here is what you can do to control where the menu positions itself.  The vertical positioning is controlled by "position: absolute;" style in all <ul>s contained within a <ul class='MenuBarVertical'>.  When you position something with absolute, it looks for its nearest parent that is positioned relatively (in this case the <li> items within <ul class='MenuBarVertical'>).  from there you can designate pixels or ems to offset from the top or bottom of the parent.  so an example of a way to do this is below.
    to give your menu the most control, you can assign each submenu its own class and decide its vertical positioning.
         your current html/css is something like:
        <style>
         ul.MenuBarVertical ul
              margin: -5% 0 0 95%;
              padding: 0;
              list-style-type: none;
              font-size: 100%;
              position: absolute;
              z-index: 1020;
              cursor: default;
              width: 8.2em;
              left: -1000em;
              top: 0;   /* <-------this is what you will change for each submenu */
         </style>
    so to change this you could assign a class name to each submenu to look something like this
    <ul class='MenuBarVertical'>
         <li>
              <a href='#' class='MenuBarItemSubmenu'>Item 1</a>
              <ul class='item_1'>
                   <li>sub1</li>
                   <li>sub2</li>
                   <li>sub3</li>
              </ul>
         </li>
         <li>
              <a href='#' class='MenuBarItemSubmenu'>Item 2</a>
              <ul class='item_2'>
                   <li>sub1</li>
                   <li>sub2</li>
                   <li>sub3</li>
              </ul>
         </li>
         <li>
              <a href='#' class='MenuBarItemSubmenu'>Item 3</a>
              <ul class='item_3'>
                   <li>sub1</li>
                   <li>sub2</li>
                   <li>sub3</li>
              </ul>
         </li>
         <li>
              <a href='#' class='MenuBarItemSubmenu'>Item 4</a>
              <ul class='item_4'>
                   <li>sub1</li>
                   <li>sub2</li>
                   <li>sub3</li>
              </ul>
         </li>
    </ul>
    and extend the class styling to control each menu's vertical position.  "top:0;" is what is default and aligns the top of the submenu with the top of its parent <li>.  Giving it a negative number would move the submenu up and a positive number would move it down (can be in pixels, ems, etc.).  You can also use "bottom:0;" to align the bottom of the submenu with the bottom of its parent <li>.  Giving it a negative number would move the submenu down, and a positive number would move it up.  So using the above menu/list format you could position each submenu exactly where you want to:
    <style>
         ul.MenuBarVertical ul
              margin: -5% 0 0 95%;
              padding: 0;
              list-style-type: none;
              font-size: 100%;
              position: absolute;
              z-index: 1020;
              cursor: default;
              width: 8.2em;
              left: -1000em;
              /* top: 0;  <-------comment this out or remove it.  we will set the position for each menu*/
         ul.MenuBarVertical ul.item_1
              top: 0;
         ul.MenuBarVertical ul.item_2
              top: -30px;
         ul.MenuBarVertical ul.item_3
              bottom: -2em;
         ul.MenuBarVertical ul.item_4
              bottom: 0;
         </style>
    Of course there are other ways to do this, but the lesson to remember is how absolute positioning works.  It looks for its nearest relatively positioned element and positions itself from that using top/bottom/left/right.  I hope this gives you a workable solution or at least gets you moving in the right direction.
    Dan

  • I changed my "View" to Full Screen..How do I change it back since the Menu Bar with "View" is no longer available in "Full Screen" ?? I tried Esc but that does not work ..

    I used the VIEW tab at the top left to change my View to "Full Screen".
    Now I cannot access the VIEW tab to change it back. How do I change it back so that that Menu will show at the top of my screen??

    Some choices:
    # F11 toggle Full Screen
    # Move mouse up through the top of the screen to menu bars, if you show them
    # "Alt+V" -- to bring up the View Menu
    More information:
    * '''Firefox and other Browser Keyboard Shortcuts''' (Comparison Table)<br>http://dmcritchie.mvps.org/firefox/keyboard.htm
    * '''Keyboard shortcuts''' | How to | Firefox Help<br>https://support.mozilla.com/kb/Keyboard%20shortcuts
    * '''Netbooks''' - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Netbooks

  • Firefox4Life78: I lost my menu bar with bookmarks, tabs, etc. How do I get them back

    I was downloading a utility from "Ask". After getting the utility loaded Ask installed itself in the menu area. I right clicked the first two lines, which were Firefox menu and tools. They disappeared, so I also got rid of Ask but now I cannot get my menu bar or tool bar back. I tried reinstalling Firefox but that did not help. I also tried add-ons but that did not work either.

    '''Menu Bar''' (File, Edit, View, History, Bookmarks, Tools, Help)
    Press ALT+ V T M (CTRL+V T M on Macs) on your keyboard. This should restore the menu bar (Firefox 3.6)
    '''Other toolbars'''
    View|Toolbars|Select the desired Toolbar
    '''Other steps to try'''
    Try restoring the default set by going to View|Toolbars|Customize| Restore Default Set. This will put the toolbars back in the default place
    '''Safe Mode'''
    You May need to reset toolbars and controls via [[Safe Mode]]
    Make sure you completely close Firefox first. When you get to the Safe Mode window, select Reset toolbars and controls and then Make Changes and Restart.
    Hope this helps!

  • Menu Bar with Menu & Menu Item Not Showing Up

    I can't see my menu bar. What is it that I'm doing wrong?
    public class menuSample extends JFrame
    {     JPanel contentPane;      
         JMenuBar menuBar;      
         JMenu testMenu;
         JMenuItem testMenuItem;
         public menuSample()
         {     super();
              initialize();
         private void initialize()
         {     contentPane = (JPanel)this.getContentPane();
              menuBar = new JMenuBar();                     
              testMenu = new JMenu();           
              testMenuItem = new JMenuItem("Test Menu Item");
    testMenu.add(testMenuItem);
              menuBar.add(testMenu);
              this.setContentPane(contentPane);
              this.setJMenuBar(menuBar);
              this.setSize(new Dimension(500,500));
              this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
              this.setVisible(true);
         public static void main (String[] args)
         {     new menuSample();      
    }

    it's there, just very small. Try this line instead of what you have:
    testMenu = new JMenu("test menu");

  • Safari 5.0.2 doesn't hide menu bar with flash full screen mode

    I have scoured these forums and others for an answer. I have deleted every little bit of Safari and Adobe/Macromedia/Flash preference file. I even tried using an older backup, which worked until I updated Safari on it.
    The menu bar won't go away!
    Is this a well known problem, or am I an unlucky slob?

    Unlucky so far, I'd say.
    So, picking something in particular so we're on the same page... does this refuse to hide the bar too?
    Is a New User Account the same ?

Maybe you are looking for

  • How can multiple hard drives to be assigned to the same device/mount?

    Every time I boot up with two or more drives besides the boot drive - the drives get assigned to different devices and their mount points get all mixed up. Is there a way I can prevent this?

  • Using utl_dbws to call web service

    We're calling a web service using utl_dbws and getting a response but the problem is the parameters. I haven't been able to find much documentation about how to use the utl_dbws package and have only one example to work from so could do with some exp

  • Sync config between active and standby CSM

    Is there a way to sync config between active and standby CSMs? Just as one that in CSS. How about two SSL Service module in two different 6500 chassis? Thanks.

  • How can I get a boot-disk for a Compaq P2500 laptop Windows XP Home Edition?

    I'm already in another forum with a eerily similar question, but that's for the HP Media Center Pavilion m8000e desktop system (Windows Vista Home Premium) I was just given; I've ordered a new hard drive for that. I assume the directions to create a

  • Use Tax Question

    Hi Experts, I have a question about Use Tax (Localization 2007 A). Where in SBO does this have an effect? I ticked the tickbox in the Company Details for Use Tax. I also setup a Taxcode with the Use Tax Accounts filled in. I tested this Taxcode in a