I have 5 button mcs that all share the same rollOver/rollOut function. However, they also each have a specific action on rollOver, for example mc1 would do the following on rollOver as well:
TweenLite.to(tips_mc.tip1, 1, { _alpha:100 });
How would I be able to add each individual call to each mc on rollOver in the array as well?
My array is as follows:
var btnArray:Array = new Array(mc1, mc2, mc3, mc4, mc5);
for (i=0; i<btnArray.length; i++) {
///initial state///
btnArray[i].enabled = true;
btnArray[i].id = i;
btnArray[i].onRollOver = function() {
this.gotoAndPlay("over");
};
btnArray[i].onRollOut = function() {
this.gotoAndPlay("out");
};
}
Any help very appreciated! Thanks!
You can write your actions in different
functions
, and invoke them like that: