hey everyone,
i have a site with all mc buttons, and the site is spread over a few scenes(arghh - i know, but this what it is)!
I have used a great protoype that lost wrote for me a while back:
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21939
so with his prototype, when you click an mc, it makes that on “highlight” and makes all the other ones in the array “lowlight”.
//array to store button instance names
var navTopArray = ["company", "commissions", "projects", "press", "contact", "credits"];
//create the prototype call changeColors
MovieClip.prototype.navTopColors = function() {
//create for loop to go through the buttonArray list
for (var i = 0; i<navTopArray.length; i++) {
//create color object that targets each clip in the array
var myColor = new Color(this._parent[navTopArray*]);
//if the instance name in the current position in the array is not equal to this clips name
if (navTopArray* != this._name) {
//set the RGB value to 0x000000 (light)
myColor.setRGB(0xffffff);
} else {
//else if it is the same as ths clips name
//set the RGB to 0xFF0000 (dark)
myColor.setRGB(0x7f7f7f);
}
}
};
But for this site i have a big problem. When you enter each scene, the relevant button is highlighted - which i did by putting this code :
_root.nav.projectssubnav.projectssub4.navSubColors();
and when the user clicks another button, they go to another scene where another button is lit up.
But now i want to set it so that on rollover, each of the other buttons lights up in a third colour, and returns to its lowlight on rollout. BUT i want the button for the current scene to always remain highlighted.
Now i can see this being a problem with the protoype i have, so does anyone know i good way round this?
I am used to html where you have up, over, down states and that is what i am trying to recreate.
I really hope there is a good way to do this using a prototype, otherwise its gonna take forever as there are 80+ buttons.
Please help in whatever way you can,
thanks
kd