Determining the depth of an instance

To determine the depth of a movie clip instance, use MovieClip.getDepth().

The following code iterates over all the movie clips on a SWF file's main Timeline and displays each clip's instance name and depth value in the Output panel.

for(each in _root) {
  var obj = _root[each];
  if(obj instanceof MovieClip) {
    var objDepth = obj.getDepth();
    trace(obj._name + ":" + objDepth)
  }
}

For more information, see MovieClip.getDepth().