MC response inside nav
Hi all,
This has been driving me mad for days so I would really appreicate if anyone can help.
I have a vertical menu made by attaching btn_mc from the libaray using an XML file. The btn_mc is a MC which has three MC’s inside - base_mc, one_mc and two_mc, I set the alpha of all MC’s to 50. I want to be able to rollOver one_mc and two_mc and it’s alpha change to 100 and also change the alpha of base_mc 100, but rolling over base_mc won’t change it’s alpha. I know this is to do with the parent clip having actions attached, but if I do without the xml using this code below it works fine.
btn_mc.base_mc._alpha = 50;
btn_mc.two_mc._alpha = 50;
btn_mc.one_mc._alpha = 50;
btn_mc.two_mc.onRollOver = function() {
this._alpha = 100;
btn_mc.base_mc._alpha = 100;
};
btn_mc.two_mc.onRollOut = function() {
this._alpha = 50;
btn_mc.base_mc._alpha = 50;
};
btn_mc.one_mc.onRollOver = function() {
this._alpha = 100;
btn_mc.base_mc._alpha = 100;
};
btn_mc.one_mc.onRollOut = function() {
this._alpha = 50;
btn_mc.base_mc._alpha = 50;
};
btn_mc.one_mc.onRelease = function() {
trace("One");
};
btn_mc.two_mc.onRelease = function() {
trace("Two");
};
This is the code I’m using with the XML file
var btnSpace = 35;
//--------------------
// Change Color
//--------------------
changeColor = function (tar, col) {
banColor = new Color(tar);
banColor.setRGB(col);
};
//--------------------
// Load XML
//--------------------
btn_xml = new XML();
btn_xml.ignoreWhite = true;
btn_xml.onLoad = function(success) {
if (success) {
btnTest();
} else {
trace("cart xml not loaded");
}
};
btn_xml.load("cart.xml");
btnTest = function () {
proNames = btn_xml.firstChild.childNodes;
for (var i = 0; i<proNames.length; i++) {
fontInfo = proNames*;
btn = holder_mc.attachMovie("btn_mc", "btn_mc"+i, i+1);
btn._y = btnSpace*i;
btn.idcolor = fontInfo.attributes.color;
btn.name_txt.text = fontInfo.attributes.name;
changeColor(btn.base_mc, btn.idcolor);
changeColor(btn.one_mc, btn.idcolor);
changeColor(btn.two_mc, btn.idcolor);
btn.base_mc._alpha = btn.one_mc._alpha=btn.two_mc._alpha=50;
btn.one_mc.onRollOver = function() {
this._alpha = 100
btn.base_mc._alpha = 100
};
btn.two_mc.onRollOver = function() {
this._alpha = 100
btn.base_mc._alpha = 100
};
btn.one_mc.onRollOut = function() {
this._alpha = 50
btn.base_mc._alpha = 50
};
btn.two_mc.onRollOut = function() {
this._alpha = 50
btn.base_mc._alpha = 50
};
}
};
Here is an example of how it should work