How to determine wich button is clicked?

I would like the submenu to become black when clicked and so on. Here’s some code (if you have the time the whole thing is included as an attachment). Greetings from Sweden.


function createSubMenu(num, nypos) {
	var array = "sm"+num+"_array";
	var totalsm = eval(array).length;
	var ypos = nypos+4;
	var c = 1;
	while (c<=submenu_array.length) {
		removeMovieClip("subnav"+c+"_mc");
		c++;
	}
	submenu_array = [];
	var a = 1;
	while (a<=totalsm) {
		ypos = ypos+hosm+1;
		attachMovie("subnav_mc", "subnav"+a+"_mc", a+30, {_x:0, _y:ypos});
		nc = this["subnav"+a+"_mc"];
		nc._alpha = 0;
		nc.itemnum = a;
		nc.menutext = eval(array)[(a-1)];
		nc.alphaTo(100, 2);
		submenu_array.push("subnav"+a+"_mc");
		a++;
	}
}