Okay all you smarty pants out there… I seem to always stumble on this – every app I build requires something similar. Here’s a simple example; if someone could please show me a better way to do it, and also explain exactly what it is they’re doing, I would benefit greatly. Apparently using eval() is a bad thing. So help me get beyond it! Please! Pleeeeeease!:
for (var i:Number = 1; i < 10; i++) {
var mcButton:MovieClip = eval("but"+i+"_mc");
mcButton.activeLayer = i;
mcButton.onRelease = function():Void {
trace("Button "+this.activeLayer+" pressed");
var mcLayer:MovieClip = eval("layer"+this.activeLayer+"_mc");
mcLayer._visible = !mcLayer._visible;
}
}
Okay, so what’s the best way to write this?
Basically just telling some MovieClips to make some other MovieClips invisible/visible when they’re clicked on.
Thanks all – you’re all wonderful people.
Steve