Easy MC name question

I’ve been away from Flash for a bit, and I’ve forgotten a few things. I’m trying to affect a random movie clip that’s on stage. How can I use the random number I generate to select my mc’s?

For example, here’s what will not work (but you’ll get what I’m trying to do):

_root.mcHolder.mc+“p”._alpha=newAlpha;

So, p=the random number. I have mc’s named mc1, mc2, mc3 and mc4, etc.

Thanks.

Try this:


_root.mcHolder["mc"+(1+Math.floor(Math.random()*4))]._alpha = newAlpha;

And see http://www.kirupaforum.com/forums/showthread.php?t=12082#post85182 for a nice explanation by senocular. :stuck_out_tongue:

Thanks all. Very nice responses.