# XML menu linking - HELP!

**URL:** https://forum.kirupa.com/t/xml-menu-linking-help/153140
**Category:** Uncategorized
**Created:** [June 29, 2005, 3:23pm UTC](https://forum.kirupa.com/t/xml-menu-linking-help/153140 "2005-06-29T15:23:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MersauX](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@MersauX](https://forum.kirupa.com/u/MersauX)
#### Post date: [June 29, 2005, 3:23pm UTC](https://forum.kirupa.com/t/xml-menu-linking-help/153140/1 "2005-06-29T15:23:55Z")

</div>

Hello, everyone! I suppose there has been such a topic already, but I cannot find it. I have been doing some XML menu (I have covered all the XML tutorials here on [kirupa.com](http://kirupa.com)) and the code is doing just fine. I am using this one:

```auto
item_spacing = 100;
item_count = 0;
function BuildMenu(menu_xml){
broj = menu_xml.firstChild.childNodes;
for(i=0;i<broj.length;i++){
if(broj*.attributes.name == "menu"){
var labels = broj*.firstChild;
var item_mc = menu_mc.attachMovie("button_mc", "button"+item_count+"_mc", item_count);
item_mc._x = item_count*item_spacing;
item_count++;
item_mc.menu_txt.text = labels.nodeValue;
}
}
}
var menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(success){
if(success){
BuildMenu(this);
}
else{
trace("Error");
}
}
menu_xml.load("menu.xml");

```

The “button\_mc” I am attaching to the “menu\_mc” consists of a dynamic text field and a rectangle which is transformed to a button using this code:

```auto
frame 1:
stop();
 
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
}
}
this.onRollOver = this.onDragOver = function(){
rewind = false;
play();
}
this.onRollOut = this.onDragOut = function(){
rewind = true;
}
 
frame 6:
stop();

```

The XML file looks something like this:

```auto
<menu>
<item name="menu" link="movie1.swf">HOME</item>
<item name="menu" link="movie2.swf">PROFILE</item>
.
.
.
</menu>

```

The menu builds without any problems. But, now comes the problematic part… I want to give those buttons in the menu the function to load .swf-s into the “loader\_mc” which is on the main timeline. “loader\_mc” is basically the place where I want my “movie1.swf” etc. to load into.

I have been trying to figure it out by myself for two days now and I gave up. I hope someone can help me with this. What can I do (what code to write) so that every button gets to load a different .swf into the “loader\_mc”?

Thanks in advance!!!:hugegrin: :hugegrin:
