Hi all,
Thanks to scotty, :thumb: I have the following code to control the x position of one single movieclip (company_mc) with five button mc’s (btn_corporate, btn_dimitriou, btn_cars, btn_cycles, btn_hertz):
function movoClip(x) {
company_mc.onEnterFrame = function() {
this._x += (x-this._x)/5;
};
}
var content = ["corporate", "dimitriou", "cars", "cycles", "hertz"];
for (i = 0; i < content.length; i++) {
this["btn_"+content*].i = i;
clip = this["btn_"+content*];
clip.onRollOver = function() {
new Color(this).setRGB(0x666666);
}
clip.onRollOut = function () {
if (!this.pushed){
new Color(this).setRGB(0xFFFFFF);
}else{
new Color(this).setRGB(0x666666);
}
}
clip.onRelease = function () {
_root.content_company.resetBut();
this.pushed = true;
new Color(this).setRGB(0xFFFFFF);
movoClip(-this.i*700);
}
}
function resetBut() {
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);
}
}
}
Now I also want to control tha alpha fade for 5 photo_mc’s (photo_corporate, photo_dimitriou, etc etc) So if btn_corparate is pussed photo_corporate should go to alpha 100 and the others to alpha 0. I think it has something to do with a nested loop, but I’m not sure and also don’t know how to implement such a nested loop insite the existing loop.
Is there somebody who can push me in the right direction :ne: