# Xml menu

**URL:** https://forum.kirupa.com/t/xml-menu/165963
**Category:** Uncategorized
**Created:** [October 15, 2005, 4:05pm UTC](https://forum.kirupa.com/t/xml-menu/165963 "2005-10-15T16:05:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![g5604](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@g5604](https://forum.kirupa.com/u/g5604)
#### Post date: [October 15, 2005, 4:05pm UTC](https://forum.kirupa.com/t/xml-menu/165963/1 "2005-10-15T16:05:34Z")

</div>

Hi,

i am trying to build a menu from a xml file. Every thing works great except i am trying to uses the fpath to work as the link for each button. But at the moment all the buttons load the same file. any ideas??

function loadData(success) {  
if (success) {  
// getting all titles and filenames  
fPath = new Array();  
fileTitle = new Array();  
files = new Array();  
files = this.firstChild.childNodes;  
files\_total = files.length;  
for (var i = 0; i\<files\_total; i++) {  
fPath = files\*.attributes.path;  
trace(fPath);  
fileTitle.push(files\*.attributes.title);  
// build filelist buttons  
bot.filelist.btn.duplicateMovieClip(“btn”+i, i);  
bot.filelist[“btn”+i].\_y = bot.filelist.btn.\_y+i_int(bot.filelist.btn.\_height)+i;  
bot.filelist[“btn”+i].txt = fileTitle_;  
bot.filelist[“btn”+i].hit.onPress = function() {  
my\_mc.loadClip(fPath\*);  
};  
}  
}  
// done. delete trash.  
delete files;  
delete files\_xml;  
}
