Coding check

I have a char called david with the instance name david2, and he walks around with the arrowkeys. There is a castle in the background and I have a line around it that has the following coding on it :

if (this.hitTest(_root.david2))

I have another frame called nearcastle and when I run into the line nothing happens. Does anyone know why this is ?