Sorry, that should be 'why' not 'which'
That would be because that is the depth of the thing you asked for. Flash does what we tell it to do, not what we want.
I can't quite tell if you are confused by the really low negative number or that you expected it to return 10?
You are asking for the depth of _root.holder, not the depth of _root.holder.introButton. Remember that attachMovie puts the newly attached movie inside the object you tell it to put it inside of.
Addtionally here is a great trick. attachMovie returns a reference to the newly attached movie so you can do something like this:
var myNewClip:MovieClip=_root.holder.attachMovie("button","introButton", 10);
trace("the attached clip is: "+myNewClip)
trace("its depth is: "+myNewClip.getDepth());
If your confusing is over the really negative number....My guess is that holder is something you placed on the timeline at author time, right? Here is a great article about the differences in how Flash handles depths between timeline placed and code placed objects.
Thank you so much for your reply. Doh, I knew it would be something obvious.
And yYes, I had come across that article.