# Basic XML-driven menu, buttonproblems

**URL:** https://forum.kirupa.com/t/basic-xml-driven-menu-buttonproblems/238559
**Category:** Uncategorized
**Created:** [September 12, 2007, 5:00pm UTC](https://forum.kirupa.com/t/basic-xml-driven-menu-buttonproblems/238559 "2007-09-12T17:00:06Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gl0gg](https://avatars.discourse-cdn.com/v4/letter/g/58956e/32.png) [@gl0gg](https://forum.kirupa.com/u/gl0gg)
#### Post date: [September 12, 2007, 5:00pm UTC](https://forum.kirupa.com/t/basic-xml-driven-menu-buttonproblems/238559/1 "2007-09-12T17:00:06Z")

</div>

hey guys!

Having some trouble here, I’m trying to make a real simple flash menu, and I am using the “Squirrel Finder”-tutorial as a base.

Problem is, when I trace my variables desc and swfURL they are correct, and the numbers on the buttons work fine as well, only when I click on the buttons all of them point to the last post in my XML, ie buttons 1,2,3,4,5 all point to swf 5. Hard to explain, and here’s the code I am having trouble with. Don’t know if I make myself clear enough to receive help :disco:

```auto
 
function skapaMeny(menu_xml) {
 var proj:Array = menu_xml.firstChild.firstChild.childNodes;
 for (var i=0; i<proj.length; i++) {
  var desc = proj*.firstChild.childNodes;
  var swfURL = proj*.firstChild.nextSibling.childNodes;
 
  var menuProj_mc = attachMovie("menuButton_mc", "menuButton" + menuItemCount, menuItemCount);
  menuProj_mc._y = menuItemCount * menuItemSpacing;
  menuItemCount++;
 
  menuProj_mc.button.onRelease = function() {
   loadMovieNum(swfURL, menuItemCount);
  }
  menuProj_mc.menuNumber_txt.text = i + 1;  
 }
}

```
