Hi I have a few buttons on the stage and a simalar quantity of mc’s with the same suffix as the buttons I would like to change the color of the movieclips at rollOver and restore the color again at rollOut. To do so I came up with the following function:
function buttons() {
for (var i in this) {
if (this*._name.substr(0, 4) == "btn_") {
clip = this*;
clip.myOver = _root["rollOver_"+clip._name.substr(4, clip._name.length)];
clip.onRollOver = function() {
this.myOver.setRGB(0xD86C01);
};
clip.onRollOut = function() {
new Color(myOver).setRGB(0xCC6600);
};
}
}
}
buttons();
But that isn’t working. What am I doing wrong?
Thanks in advance