I have the following code to control the rollOver, rollOut and release states from my buttons (btn_company, btn_products, btn_services and btn_enquiry):
for (var i in this) {
if (this*._name.substr(0, 4) == "btn_") {
setKnop(this*._name);
}
}
function setKnop(clip) {
var clip = eval(clip);
clip.onRollOver = function() {
new Color(clip).setRGB(0xA10000);
};
clip.onRollOut = function() {
if (!this.pushed) {
new Color(clip).setRGB(0xFFFFFF);
} else {
new Color(clip).setRGB(0xA10000);
}
};
clip.onRelease = function() {
_root.resetKnop();
this.pushed = true;
// delete clip.onRollOver;
new Color(clip).setRGB(0xA10000);
showHeader(this._name.substr(4));
};
}
function resetKnop() {
for (var i in this) {
if (this*._name.substr(0, 4) == "btn_") {
var clip = eval(this*._name);
clip.pushed = false;
new Color(clip).setRGB(0xFFFFFF);
}
}
}
I also have 4 movieclips (title_company, title_products, title_services and title_enquiry) which I also want to control with those buttons. When btn_company is pressed, title_company should go to frame 2, When after that btn_products is pressed title-products should go to frame 2 and title-company should go back to frame one. Is there anybody who can help me?