# Cascading Menu driven by XML

**URL:** https://forum.kirupa.com/t/cascading-menu-driven-by-xml/185601
**Category:** flash
**Created:** [April 14, 2006, 3:41pm UTC](https://forum.kirupa.com/t/cascading-menu-driven-by-xml/185601 "2006-04-14T15:41:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![frankiebones](https://avatars.discourse-cdn.com/v4/letter/f/3bc359/32.png) [@frankiebones](https://forum.kirupa.com/u/frankiebones)
#### Post date: [April 14, 2006, 3:41pm UTC](https://forum.kirupa.com/t/cascading-menu-driven-by-xml/185601/1 "2006-04-14T15:41:59Z")

</div>

Okay I have the menu that hga77 built but I want to add a few attributes to it. Everytime I add the attributes I get more buttons for somereason or another and the function does not work like it should. Hga77’s script is easy to follow but difficult to moddify.

I want to add something like the following to his menu so I can set everything up in the XML file.

vt.menuObj[“item”+j].what = menu\_xml.firstChild.childNode\*.attributes.what;  
vt.menuObj[“item”+j].where = menu\_xml.firstChild.childNodes{i].attributes.where;  
vt.menuObj[“item”+j].the\_type = menu\_xml.firstChild.childNodes\*.attributes.type;

and then be able to have either the main buttons or the sub buttons do the following function:

onRelease = function() {  
if (this.the\_type != undefined) {  
if ((this.the\_type == “geturl”) or (this.the\_type == “getURL”)) {  
unloadMovie(\_root.dropZone);  
getURL(this.what, this.where);  
}  
if ((this.the\_type == “gotoAndPlay”) or (this.the\_type == “gotoandplay”)) {  
unloadMovie(\_root.dropZone);  
tellTarget (this.where) {  
gotoAndPlay(this.what);  
}  
}  
if ((this.the\_type == “gotoAndStop”) or (this.the\_type == “gotoandstop”)) {  
unloadMovie(\_root.dropZone);  
tellTarget (this.where) {  
gotoAndStop(this.what);  
}  
}  
if ((this.the\_type == “loadMovie”) or (this.the\_type == “loadmovie”)) {  
loadMovie(this.what, this.where);  
}  
if ((this.the\_type == “attachMovie”) or (this.the\_type == “attachmovie”)) {  
tellTarget (this.where) {  
attachMovie(this.what, this.what+i, i);  
}  
}  
if ((this.the\_type == “fsCommand”) or (this.the\_type == “fscommand”)) {  
unloadMovie(\_root.dropZone);  
fscommand(this.what, this.where);  
}  
if ((this.the\_type == “function”) or (this.the\_type == “Function”)) {  
unloadMovie(\_root.dropZone);  
eval(this.where)this.what;  
}  
}  
};

---

<div class="post-metadata">

### Author: ![frankiebones](https://avatars.discourse-cdn.com/v4/letter/f/3bc359/32.png) [@frankiebones](https://forum.kirupa.com/u/frankiebones)
#### Post date: [April 15, 2006, 5:19pm UTC](https://forum.kirupa.com/t/cascading-menu-driven-by-xml/185601/2 "2006-04-15T17:19:47Z")

</div>

anyone?
