TypeError: Error #1006:- how do I fix it?

i wrote this code:
if (frog.visible &&frog2.hitTestObject(line_mc))
{
frog2.visible = false;
this.gotoAndPlay(3);
}

and it does this error:
TypeError: Error #1006: gotoAndStop is not a function.
at Function/<anonymous>()

why is it does that and how do I fix it?