Help with if statements and variables

now i know this is prolly a very simple thing to do, but i havent used flash in a really long time and im tring to get into it, but dont remember anything for the most part. basicly what i am tring to do is make it so that when you click on a menu option at the top which is in its own movie clip, it will check a variable i have stored on the main movie and using if else statements play a certain part of a different movie clip. on the main clip i have the variable stored as

_global.titlebar = “main”;

and then on the button i have

on(release){
if (titlebar = “main”){
_root.menuobject.gotoAndPlay(2);
_global.titlebar = “profile”;
}
}

am i even close to what i need to do. i have all the instance names correct and have checked that many of times.