Help with .getDepth()

I’m trying to use .getDepth() but it returns nothing. :S

 if (this.getDepth() < _root.blocks.getDepth()) { 

Is this the right way to do this?