Variable/Function advice

I’m setting up a document similar to a website. Say six buttons linking to six sections. I initially wrote a function to move “x stage” into view while removing whatever else was showing at the time. So it looked something like this (which works):

home = function () {
	setProperty(this.stage1, _x, 0);
	setProperty(this.stage1, _visible, 1);
	setProperty(this.stage2, _x, -1025);
	setProperty(this.stage2, _visible, 0);
	setProperty(this.stage3, _x, -1025);
	setProperty(this.stage3, _visible, 0);
	setProperty(this.stage4, _x, -1025);
	setProperty(this.stage4, _visible, 0);
	setProperty(this.stage5, _x, -1025);
	setProperty(this.stage5, _visible, 0);

Now I had that repeated for each stage adjusting the property for each one. Pain. I started thinking … wait … if we add more pages, that’s a ton to write. So then I thought … maybe I could set it up so the button would tell the function what stage to set … then I’m not so sure about that, but anyways.

Does anyone have advice on the best way to write this? Should I use a variable defined by a button to swap out “stages”. I looked into loading them from the library, but it screwed up some of the components I’m using. There has to be an easier way.

Thanks for any advice.