# XML MENU - Scope?

**URL:** <https://forum.kirupa.com/t/xml-menu-scope/206699>\
**Category:** Uncategorized\
**Created:** [November 10, 2006, 3:07pm UTC](https://forum.kirupa.com/t/xml-menu-scope/206699 "2006-11-10T15:07:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coop](https://avatars.discourse-cdn.com/v4/letter/c/87869e/32.png) [@coop](https://forum.kirupa.com/u/coop)\
**Post date:** [November 10, 2006, 3:07pm UTC](https://forum.kirupa.com/t/xml-menu-scope/206699/1 "2006-11-10T15:07:12Z")

</div>

Hi all,

What I have is a menu from attached MC’s with the infomation coming from a XML file. I also have images on the stage with alpha set to 0, I want to display the images by changing there \_alpha when rolling over the menu. Which image to display on which button comes from the XML as well, but I carn’t get it to work.

[AS]  
var btn\_spacing = 18;  
one\_mc.\_visible = false;  
two\_mc.\_visible = false;  
three\_mc.\_visible = false;  
four\_mc.\_visible = false;  
five\_mc.\_visible = false;  
six\_mc.\_visible = false;  
seven\_mc.\_visible = false;  
//  
//  
myXml = new XML();  
myXml.ignoreWhite = true;  
myXml.onLoad = function(success) {  
if (success) {  
loadNav();  
} else {  
trace(“XML not loaded”);  
}  
};  
myXml.load(“Nav.xml”);  
loadNav = function () {  
start = myXml.firstChild.childNodes;  
for (var i = 0; i\<start.length; i++) {  
info = start\*;  
navBtn = navHolder\_mc.attachMovie(“btn\_mc”, “btn\_mc”+i, i+1);  
navtBtn.base\_mc.\_alpha = 0;  
navBtn.\_y = btn\_spacing\*i;  
navBtn.name = info.attributes.name;  
navBtn.idColor = info.attributes.color;  
navBtn.display = info.attributes.display;  
navBtn.name\_txt.text = navBtn.name;  
navBtn.onRollOver = function() {  
this.base\_mc.\_alpha = 85;  
changeColor(this.base\_mc, this.idColor);  
this.name\_txt.textColor = 0x333333;  
this.display.\_visible = true  
trace(this.display);  
};  
navBtn.onRollOut = function() {  
this.base\_mc.\_alpha = 0;  
this.name\_txt.textColor = 0xffffff;  
};  
navBtn.onDragOut = function() {  
this.base\_mc.\_alpha = 0;  
this.name\_txt.textColor = 0xffffff;  
};  
}  
};  
changeColor = function (tar, col) {  
banColor = new Color(tar);  
banColor.setRGB(col);  
};  
[/AS]

the xml

[AS]  
\<?xml version=“1.0” encoding=“ISO-8859-1”?\>  
\<menu\>  
\<nav display=“one\_mc” name=" ONE" color=“0xffcc00” /\>  
\<nav display=“two\_mc” name=" TWO" color=“0x0fc9f0” /\>  
\<nav display=“three\_mc” name=" THREE" color=“0x75ee11” /\>  
\<nav display=“four\_mc” name=" FOUR" color=“0xf807ce” /\>  
\<nav display=“five\_mc” name=" FIVE" color=“0xf50a80” /\>  
\<nav display=“six\_mc” name=" SIX" color=“0xffff00” /\>  
\<nav display=“seven\_mc” name=" SEVEN" color=“0x9ef807” /\>  
\</menu\>  
[/AS]
