I have created a bunch of movie clips which all have similar names and then after some other event I have built up a string like:
var clipName = 'barLeft42'
which is held inside another movie clip called ‘thing’.
I have been able to get hold of a reference using:
var movieClip = Eval( '_root.thing.' + clipName )
But that feels bad – is there a better way?
Movie clips are collections in actionscript (like most and similar to javascript, everything is basically key-value pairs). You can index into the collection using square brackets and a string for the key name like:
That should do the trick for you…