Weird question, for sure. I have a movie that randomly generates duplicated movies with random names. Is there a way to check or list all the movie instances on the root of a movie?
Printable View
Weird question, for sure. I have a movie that randomly generates duplicated movies with random names. Is there a way to check or list all the movie instances on the root of a movie?
Yes, you can. I assume that you are populating the name of each MC when you duplicate it. You can loop through the DisplayObject using the numChildren and the length and pull the names you want.
I suggest that when you duplicate a movie you store it in an array, this way it is much easier to access and identify, don't rely on the naming convention of Flash alone.
only if this is AS3.. (which in that case would probably be better served, by being posted int he AS3 forum?)
I dont believe AS2 has a Display Object.. ;)
Or, if this is for debugging only, once in test mode, you can also select debug>list objects. You'll see them all with their absolute paths.
gparis
Thank you all, you clarify mi mind. I am using AS2, I think the array will be the best way, but I just wanted to check if there was another option. Thanks!
AS2 code...
Code:function doShowMC(mc) {
for (var i in mc) {
if (typeof (mc[i]) == "movieclip") {
trace(i+" "+mc[i]);
}
}
}
doShowMC(_root);
Wow! Amazing! I believed it wasn´t possible! Thanks dawsonk, genius!