What is the best way to keep track of and be able to call on dynamically loaded MCs that are attached from the library?
ok… basically i’ve got this xml document that loads (just fine) into flash and attaches MCs based on the child nodes. What i want to do is be able to call one function and have it repeat on all the MCs taht are attached on the stage.
Any suggestions? So far I’ve thought about using an array to keep up with them, but I haven’t tried that. So far I’ve only got loops that aren’t working.
First of all, you can reference dynamic movie clips like this:
location[“name”+var]
example: _root[“mymovie”+i]
if you use a for() loop to go through the ‘i’ variable, you can affect all the movie clips in the _root timeline named mymovie1, mymovie2, mymovie3, etc.
ok… well, i have gotten the code working, but it only effects the last symbol for some reason (i’m calling the same function in a loop). I wonder why it’s only affecting one of them?
It seems that you are resetting ‘clicks’ every time you run through the loop because ‘clicks’ is not a unique instance name, even though it is referencing a unique object.
Instead of using clicks just use this[“button”+count]
That should work I think.
yeah, that’s when you have to use an array and loop through it. You might also be able to do it by setting up child / parent relationships, but I always use the array.
yeah, for that, you should loop through the movie and execute them manually. if you are consistent with naming your movie clips, you can do it like this: