If statement help

Hello again guys,
I was wondering how I could get an if statement to do the following:
So I have a mask MC and a content MC. The Mask MC is inside the content MC. The question is, How can I can I get the content MC to change only if the Mask MC is on a certain frame?
Here is the code I tried to use:

menuP.content1.maskA.gotoAndPlay(5);
if(menuP.content1.maskA.frame==8){
	menuP.content1.gotoAndStop("contact");
	}

Thanks =)