I wonder if there is a “neat” way of creating onRollOver functions for a bunch of mc’s with a for loop?
Imagine a _root with four boxes. Each box contains a “dummy mc” that will be used as a hit area for the mouse.
So you roll over the invisible dummy inside box03 in _root and within the onRollOver function a tween is fired that scales up the box03 to 120%. You roll out, the box goes back to 100%.
In code:
_root.box03.frame03.onRollOver = function () {
_root.box03.scaleTo(120,1,);
}
Can I turn this into a “for loop” so that I don’t have to duplicate the code for each instance? I can probably do it if it’s on level deep, but I don’t know the syntax for accessing a clip that is two levels deep…
one level deep for loop: _root[“box0”+i].onRollOver
Am I clear?