# MX: Xml Menu issues

**URL:** <https://forum.kirupa.com/t/mx-xml-menu-issues/219483>\
**Category:** flash\
**Created:** [March 16, 2007, 8:42pm UTC](https://forum.kirupa.com/t/mx-xml-menu-issues/219483 "2007-03-16T20:42:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsj4](https://avatars.discourse-cdn.com/v4/letter/t/7ea924/32.png) [@tsj4](https://forum.kirupa.com/u/tsj4)\
**Post date:** [March 16, 2007, 8:42pm UTC](https://forum.kirupa.com/t/mx-xml-menu-issues/219483/1 "2007-03-16T20:42:35Z")

</div>

[SIZE=2][FONT=Verdana][SIZE=4][COLOR=#003366]\*\* XML-Driven\*\* Drop-Down Menu tutorial  
[/COLOR][/SIZE][/FONT][/SIZE]I have grabbed this code to creat a xml menu. I have got it read and generate the menu and I have each menu\_item clickable. I have an array of objects that defines my Xml nodes and I need the problem seems to be that my array seems to be out of scope within the menu\_item function.

[SIZE=2][FONT=Verdana][SIZE=4][COLOR=#003366]

code:  
[/COLOR][/SIZE][/FONT][/SIZE] GenerateMenu = function (container, name, x, y, depth, xmlNode) {  
var curr\_node;  
var curr\_item;  
var curr\_menu = container.createEmptyMovieClip(name, depth);  
for (i=0; i\<xmlNode.childNodes.length; i++) {  
curr\_item = curr\_menu.attachMovie(“menuitem”, “item”+i+"\_mc", i);  
curr\_item.\_x = x+5;  
curr\_item.\_y = y+i_curr\_item.\_height+105;  
curr\_item.trackAsMenu = true;  
curr\_node = xmlNode.childNodes_;

```
    // this is in scope
    curr_item.name.text = jean_arr*.name;
    curr_item.onRelease = function() {
        if (pLoaded == pFilesize) {
            picture._alpha = 0;
            
            // none of these are in scope
            picture.name_txt.text = jean_arr*.name;
            picture.holder.loadMovie(jean_arr*.image, this.getNextHighestDepth());
            picture.picture.desc_txt.text = jean_arr*.description[0];
            picture.dHolder.tholder.loadMovie(jean_arr*.thumb[0], this.getNextHighestDepth());
            //
        }
        if (xmlNode.childNodes*.nodeName == "item") {
            curr_item.xmlNode = curr_node;
            curr_item.onRollOver = curr_item.onDragOver=function () {
                var x = this._x+this._width-5;
                var y = this._y+5;
            };
        }
    };
}

```

};
