Retrieving a MovieClip's name from a mouse click into a function

I’m not proud of my subject line, but it was the best I could do.

I’m using this while loop to activate the function buttonpressed from one of five buttons named thumb0, thumb1, etc.:

i = -1; while (i++ < 4){this[“thumb”+(i)].addEventListener(MouseEvent.MOUSE_UP,buttonpressed);}

I want the main timeline to jump to the labeled frame corresponding with the targeted button’s number

function buttonpressed(evt:MouseEvent):void{MovieClip(root).gotoAndStop(“clip”+*);}

I know this isn’t correct. The i is always 5, its last defined value after the loop has run.