Add onclick function

Hi All,

I`m working on this script to use as menu:

iterations=7;
_root.object0.number=0;
_root.object0.iterations=iterations;
for (i=1; i<(iterations+1); i++) {
	duplicateMovieClip ("object0", "object"+i, i);
	_root["object"+i].number=i;
	_root["object"+i].iterations=iterations;
	_root["object"+i].gotoAndStop(i+1);
}
Movieclip.prototype.tan_load=function(){
boolean=0;
mycol=new Color(this);
x=(2*Math.PI)*(number/iterations);
};

I can`t figure out how to add the onclick function to the designated object. In the end I want to set a variable and a goto action to end up on the correct slide.
Comments appreciated, thx,
m.