Tracking what button has been clicked... Need some help

Hi All

I have a script to do partially what I need to do… basically control some buttons but I need to track which button has been clicked and then assign a numerical value to a variable called buttonclicked so I can refer to this variable and pull info from an XML document on frame 5. Here’s the short script…

stop();

this.button1.textBTN_txt.text = "ABOUT US";
this.button2.textBTN_txt.text = "SERVICE";
this.button3.textBTN_txt.text = "PORTFOLIO";
this.button4.textBTN_txt.text = "CONTACT";

var buttonNum:Number = 4;

for (i=1; i<=buttonNum; i++) {
	this["button"+i].onRollOver = function() {
		if (this.clicked != "yes") {
			this.gotoAndPlay("over");
			
		}
	};
	this["button"+i].onRollOut = function() {
		if (this.clicked != "yes") {
			this.gotoAndPlay("out");
		}
	};
	this["button"+i].onRelease = function() {
		gotoAndPlay(5);
		_global.buttonclicked=[COLOR="Red"]?what do I need to put here?[/COLOR];
		this.gotoAndStop("out");
		this._parent[_root.clickedButton].gotoAndPlay("out");
		this._parent[_root.clickedButton].clicked = false;
		this._parent[_root.clickedButton].enabled = true;
		_root.clickedButton = this._name;
		this.clicked = "yes";
		this.enabled = false;
		_root.on_txt.text=this._name +" in "+this.textBTN_txt.text;
	};
}

Can anyone help?

Regards

Nick