How to check on all MC?

Hello,

I’m looking for a way to check the depth on every each movie clip in a movie clip to know what’s the highest depth of all…
But the number of mc clip can vary depending on the situation. So is it possible to do something like:

check all mc in that mc and give me the depth of the “highest” objet.

The depth thing is not a problem here but to tell him to check all is a pb to me cause there’s no . command hehe

use a for…in loop

for(prop in myMovieClip){
     trace(myMovieClip[prop].getDepth());
}

(you may need to add some checks to make sure prop is in fact a movieclip)

something like

[AS]for(var prop in myMC_mc){
if(typeof myMC_mc[prop] == “movieclip”){
// check whether i (counter variable is undefined:
if(!i){
var i = 0;
}
if(myMC_mc[prop].getDepth() > i){
i = myMC_mc[prop].getDepth();
}
}
}
trace(i);
[/AS]
:wink:

you guys rule, can’t say anything else :slight_smile: :slight_smile: :slight_smile: