gotoAndStop in Classes

I want my game to go to gameover when i lose all my lives, and for that i used a var in my class called currentStage. Then, when my lives are 0, i used

currentStage.gotoAndStop("gameover");

Except it won’t work. It says “called to a undefined gotoAndStop method”. Any ideas?