# AS2.0: filtering nodes in menu

**URL:** <https://forum.kirupa.com/t/as2-0-filtering-nodes-in-menu/213437>\
**Category:** Uncategorized\
**Created:** [January 19, 2007, 4:15pm UTC](https://forum.kirupa.com/t/as2-0-filtering-nodes-in-menu/213437 "2007-01-19T16:15:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thatguythatsme](https://avatars.discourse-cdn.com/v4/letter/t/c0e974/32.png) [@thatguythatsme](https://forum.kirupa.com/u/thatguythatsme)\
**Post date:** [January 19, 2007, 4:15pm UTC](https://forum.kirupa.com/t/as2-0-filtering-nodes-in-menu/213437/1 "2007-01-19T16:15:50Z")

</div>

I’m currently modifying an xml menu found in the kirupa tutorials and Ive gotten stuck. I want the menu to filter into different columns depending on a xml node called type="". So far I have this but I cant seem to get my head around how to filter the menu.

```auto

GenerateMenu = function (container, name, x, y, depth, node_xml) {
    var currNode;
    var currItem;
    var currMenu = container.createEmptyMovieClip(name, depth);
    for (var i = 0; i<node_xml.childNodes.length; i++) {
        currItem = currMenu.attachMovie("menuitem", "_mc", i);
        if (currItem.type == web) {
            currItem._x = x;
            currItem._y = y+i*currItem._height;
        }
        currItem.trackAsMenu = true;
        currNode = node_xml.childNodes*;
        currItem.type = currNode.attributes.type;
        currItem.description = currNode.attributes.description;
        currItem.name.text = currNode.attributes.name;
        currItem.onRelease = function() {
            xmlDoc = this.name.text;
            projectType = this.type;
            proDescription.text = this.description;
            xmlProject.load(xmlDoc+"/project.xml");
            resetSlideshow();
            trace("this is == "+projectType);
        };
    }
};

```

at the moment all I’ve tried to do is filter the menu with an if statement to only display the type node with “web” in them. As soon as I undestand how this is done I sohuld be albe to do the rest myself.

Any help would be greatly appretiated.

Dave
