Using variables to show/hide buttons - why doesn't this work?

	var showbutton="buttonone";
	var currentpage="pageone";
	this[showbutton]._visible = false;
	
buttonone.onRelease = function() {
	if(currentpage != "pageone"){		
	this[showbutton]._visible = true;
	buttonone._visible = false;
	trace(showbutton);
	showbutton = "buttonone";
	}
};

buttontwo.onRelease = function() {
	if(currentpage != "pagetwo"){
	this[showbutton]._visible = true;
	trace(showbutton);
	buttontwo._visible = false;
	showbutton = "buttontwo";
	}
};

so the idea is just that when you click one button the other disappears
and vice versa - what i don’t get is that the code at the top which makes
the button disappear works - then when i try to do it within the if…else statement it doesn’t. trace shows that the variable is correct…errrrrr

please help…i no understandie

:red: