Variable value not working in buton menu

Im creating a menu navigation, which loads a sub menu movie clip from the library on specific button press. It does this by looking at the current selection (a number variable) and closing the currently active submenu. Once loaded it then changes the number variable to the value of the current submenu.

This works fine, most of the time… sometimes the number variable and menu loaded is completely wrong.

There are six buttons on the menu bar, included is sample script from the ‘About’ button, there is more to the script but it is instances of this sample, only button names etc change.

about_btn.onRelease = function() {
	if (navID == 1) {
		_root.submenuHome_mc.gotoAndPlay("close");
		this.onEnterFrame = function () {
			if (_root.submenuHome_mc._currentframe == 34) {
				_root.submenuHome_mc.unloadMovie();
		 	//attach submenu movie clip from library and set parameters
		 	attachMovie("about_mc", "submenuAbout_mc", 0, {_x:629.7, _y:195});
				_root.submenuAbout_mc.gotoAndPlay("execute");
				_root.submenuText.gotoAndPlay("execute");
				//set text variables on page
				_root.submenuText.navName.text = "ABOUT";
				navID = 2;
			}
		}
	} else if (navID == 2) {
		_root.submenuAbout_mc.gotoAndStop("open");
	} else if (navID == 3) {
		_root.submenuPortfolio_mc.gotoAndPlay("close");
		this.onEnterFrame = function () {
			if (_root.submenuPortfolio_mc._currentframe == 34) {
				_root.submenuPortfolio_mc.unloadMovie();
		 	//attach submenu movie clip from library and set parameters
		 	attachMovie("about_mc", "submenuAbout_mc", 0, {_x:629.7, _y:195});
				_root.submenuAbout_mc.gotoAndPlay("execute");
				_root.submenuText.gotoAndPlay("execute");
				//set text variables on page
				_root.submenuText.navName.text = "ABOUT";
				navID = 2;
			}
		}

If anyone can see an error with this would be very grateful for opinion, thanks.