Error #1006: getChildByName is not a function

I’m trying to use the getChildByName function and for some reason it’s not working. Here’s the line that is causing the error of “TypeError: Error #1006: getChildByName is not a function.”

var contactBox:MovieClip = anyBox.getChildByName("earthBox" + i);

It is in a for loop and is definitely calling to a movieclip of the correct name in the MC array anyBox. I’ve searched the internet and haven’t found anything (On the first page of google…) Any advice?