PDA

View Full Version : Can you refer to instances with a variable names?


Scoopey
05-17-2005, 10:46 PM
Hello there folks!
I got a good problem here that I hope someone can help me out with.
I have a number of movie clips on the stage with instance names called somewhat originally square0, square1, square2 etc.
I'd like to attach another clip to any one of them using the attach movie script but realised that you cannot use a variable to refe to an instance
var something = "square0";
something.attachMovie("Anything","marker", 1);
Is there anyway around this other than the obvious writing numerous if statements?
Steve C

deadbeat
05-17-2005, 10:48 PM
var something = "square0";
_root[something].attachMovie("Anything","marker", 1);


K.