Hello. I am trying to get 50 rectangular MC’s to scale larger and fade to another color on rollover and rollouts. However, with the code I am using my processor can’t handle it after about 8-10 MC’s have been rollovered. Can anyone offer a better way to do this? Here is my code:
on main timeline frame1:
MovieClip.prototype.fadeColor = function(cto, e, finalWidth, finalHeight, speed) {
var myColor = new Color(this), cColor = myColor.getTransform();
this.onEnterFrame = function() {
this._width += Math.floor((finalWidth-this._width)/speed);
this._height += Math.floor((finalHeight-this._height)/speed);
for (var c in cColor) {
cColor[c] += (cto[c]-cColor[c])/e;
}
myColor.setTransform(cColor);
};
};
on mc’s:
on (rollOver){
_root.test.ball.useHandCursor = false;
_root.test.ball.fadeColor({rb:204, gb:0, bb:0, ab:175}, 5, 200, 200, 10);
}
on (rollOut){
_root.test.ball.fadeColor({rb:0, gb:0, bb:0, ab:170.85}, 5, 134.4, 134.4, 10);
}
Thank you very much.