Variable problem

im kind of new to flash actionscripts and im having lots of trouble with this script

on (release) {
if (v = 0)
nav2.gotoAndPlay(“up”);
gotoAndPlay(“contact”);
trace (v);}

all i want it to do is check of a menu is open and if it is close it (“up”) then carry on to its final destination. the menu sets v to 0 when it is actived, but this button on the main time line wont do as i ask it even though the value is 0?? any ideas anyone?