Target a _root frame label from inside MC

Just wondering how this is done within an “if then” statement. I need a code like

if (_root.frame = “home”) then {
this.quickHome.onPress = function () {
_root.gotoAndPlay (“homeToContact”);
}
}

I know the first line isn’t going to work, but just wondering if someone knew of a code that would?

thanks in advance…

(btw _root always targets the main time line correct? not just the timeline of a mc which the instance is placed in right?)