# XML Menu attached MovieClip

**URL:** <https://forum.kirupa.com/t/xml-menu-attached-movieclip/207592>\
**Category:** flash\
**Created:** [November 19, 2006, 6:58pm UTC](https://forum.kirupa.com/t/xml-menu-attached-movieclip/207592 "2006-11-19T18:58:04Z")\
**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 19, 2006, 6:58pm UTC](https://forum.kirupa.com/t/xml-menu-attached-movieclip/207592/1 "2006-11-19T18:58:04Z")

</div>

Hi all,

I have a simple menu from an XML file which is in a MovieClip that is attached using attachMovie. This works fine, but I want to load another movie with attachMovie underneath the MC with the menu in. So what I want is background MovieClip is attached with attachMovie then on top of this another MC is attached this top MC is where the Menu will be loaded. If I load the menu MC on it’s own the menu works fine. If I attach the background MC and then the Menu MC on top the Menu doesn’t work.

any help

[AS]  
this.attachMovie(“back\_mc”, “back\_mc”, 1);  
back\_mc.\_alpha = 0;  
back\_mc.onEnterFrame = function() {  
this.\_alpha += 20;  
if (this.\_alpha\>=100) {  
this.\_alpha = 100;  
delete this.onEnterFrame;  
firstPage();  
}  
};  
firstPage = function () {  
this.attachMovie(“firstPage\_mc”, “firstPage\_mc”, 2);  
firstPage\_mc.\_alpha = 0;  
firstPage\_mc.\_x = 50;  
firstPage\_mc.\_y = 20;  
firstPage\_mc.onEnterFrame = function() {  
this.\_alpha += 20;  
if (this.\_alpha\>=100) {  
this.\_alpha = 100;  
delete this.onEnterFrame;  
}  
};  
};  
//  
//  
changeColor = function (tar, col) {  
banColor = new Color(tar);  
banColor.setRGB(col);  
};  
//  
//  
firstXml = new XML();  
firstXml.ignoreWhite = true;  
firstXml.onLoad = function(success) {  
if (success) {  
openNav();  
} else {  
trace(“First Page XML not Laoded”);  
}  
};  
firstXml.load(“nav.xml”);  
openNav = function () {  
open = firstXml.firstChild.childNodes;  
for (var n = 0; n\<open.length; n++) {  
openInfo = open[n];  
firstNav = firstPage\_mc.firstNav\_mc.attachMovie(“firstBtn\_mc”, “firstBtn\_mc”+n, n+1);  
firstNav.base\_mc.\_alpha = 0;  
firstNav.\_y = 18\*n;  
firstNav.name = openInfo.attributes.name;  
firstNav.idColor = openInfo.attributes.color;  
firstNav.name\_txt.text = firstNav.name;  
firstNav.onRollOver = function() {  
this.base\_mc.\_alpha = 85;  
changeColor(this.base\_mc, this.idColor);  
};  
firstNav.onRollOut = function() {  
this.base\_mc.\_alpha = 0;  
};  
}  
};  
[/AS]
