# Help! Adding images to senocular's XML menu

**URL:** <https://forum.kirupa.com/t/help-adding-images-to-senoculars-xml-menu/212231>\
**Category:** Uncategorized\
**Created:** [January 9, 2007, 2:52pm UTC](https://forum.kirupa.com/t/help-adding-images-to-senoculars-xml-menu/212231 "2007-01-09T14:52:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ygramul](https://avatars.discourse-cdn.com/v4/letter/y/7993a0/32.png) [@Ygramul](https://forum.kirupa.com/u/Ygramul)\
**Post date:** [January 9, 2007, 2:52pm UTC](https://forum.kirupa.com/t/help-adding-images-to-senoculars-xml-menu/212231/1 "2007-01-09T14:52:25Z")

</div>

I’m working on a navigation bar based off of senocular’s [amazing XML drop-down menu tutorial](http://www.kirupa.com/developer/actionscript/xml_dropdown_menu.htm). I’ve managed to make the menu horizontal, and changed the boxes from rectangles to squares. All of that works fine.

Now I need to figure out how to add an image to the inside of each element, and I can’t figure out how to do that. I’ve added

```auto
curr_item.image = curr_node.attributes.image;

```

to the AS, and added an ‘image’ movieclip inside my menuitem, but that doesn’t appear to work.

Here’s my complete actionscript:

```auto

GenerateMenu = function(container, name, x, y, depth, node_xml) {
    var curr_node;
    var curr_item;
    var curr_menu = container.createEmptyMovieClip(name, depth);
    for (var i=0; i<node_xml.childNodes.length; i++) {
        curr_item = curr_menu.attachMovie("menuitem", "item"+i+"_mc", i);
        curr_item._x = x + i*curr_item._width*1;
        curr_item._y = y;
        curr_item.trackAsMenu = true;
        curr_node = node_xml.childNodes*;
        curr_item.action = curr_node.attributes.action;
        curr_item.variables = curr_node.attributes.variables;
        curr_item.name.text = curr_node.attributes.name;
        curr_item.image = curr_node.attributes.image;
        curr_item.onRelease = function() {
            Actions[this.action](this.variables);
        };
    }
};

Createmainmenu = function(x, y, depth, navXML) {
    GenerateMenu(this, "navmenu_mc", x, y, depth, NavXML.firstChild);
};

Actions = Object();
Actions.gotoURL = function(urlVar){
    getURL(urlVar, "_self");
};

navXML = new XML();
navXML.ignoreWhite = true;
navXML.onLoad = function(ok) {
    if (ok){
        Createmainmenu(50, 280, 0, this);
    }
};
navXML.load("navigation.xml");

```

And here’s my XML:

```auto

<navigation name="links">
    <item name="About Us" action="gotoURL" variables="http://www.google.com" image="image0.jpg" />
    <item name="Featured" action="gotoURL" variables="featured.html" image="image1.jpg" />
    <item name="Search" action="gotoURL" variables="search.html" image="image3.jpg" />
    <item name="Buyers" action="gotoURL" variables="reseller.html" image="image4.jpg" />
    <item name="Communities" action="gotoURL" variables="communities.html" image="image5.jpg" />
    <item name="Contact" action="gotoURL" variables="contact.html" image="image6.jpg" />
</navigation>

```

And attached at the bottom is the .fla. Please help!
