
Welcome Guest
|
#1
|
|||
|
|||
|
MC response inside nav
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. Actionscript:
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 Actionscript:
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[i];
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 http://homepage.ntlworld.com/c.dickinson40/ |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MC inside MC, no response | scooper | Flash MX |
1 | 01-09-2007 11:37 PM |
| How to modify a SQL query inside an ASP-page using Flash variables values? | Andino | Web Platforms - PHP, JSP and .NET | 6 | 07-20-2006 08:37 PM |
| Not able to get the lines inside scrollpane | superprg1 | Flash MX 2004 |
3 | 10-23-2005 06:21 PM |
| Problems animating a movieclip inside a moviclip inside another movieclip | alkiev | Flash MX 2004 |
2 | 10-14-2005 02:42 AM |
| Load movie, nav bar, ahhhhh??? | macflasher | Flash 5 and below | 3 | 04-17-2001 11:51 AM |





