PDA

View Full Version : How many MC in a level?



Uli
October 18th, 2004, 03:00 PM
Hello,

Is it possible to check the number of movieclips in a level? Any direction?
TiA :)

Rasper
October 18th, 2004, 03:22 PM
My first reply, JAY!

Maybe you can do something with the following piece of code, taken from The Definitive Guide by Colin Moock:


function findClips (myClip, indentSpaces) {
// Use spaces to indent the child clips on each successive tier
var indent = " ";
for (var i = 0; i < indentSpaces; i++) {
indent += " ";
}
for (var property in myClip) {
// Check if the current property of myClip is a movie clip
if (typeof myClip[property] == "movieclip") {
trace(indent + myClip[property]._name);
// Check if this clip is parent to any other clips
findClips(myClip[property], indentSpaces + 4);
}
}
}
findClips (_root, 0); // Find all clip instances descended from main timeline


Just copy paste that anywhere you please.