Help with CS3 gotoAndPlay()

I’m a total flash and actionscript newbie. I’m having some problems coding some actionscript for an animation created by a friend. He’s created the entire animation and has asked me to insert some code that will execute certain parts of the animation only if a click or mouse over event occurs.

What I want to do is this. Go to a certain frame number and then execute a gotoAndPlay(frame number) function on it. Once the animation has run for a certain number of frames I want it to stop. How do I get it to do this? And the animation is not on the root timeline so I can’t even use root.currentFrame() to find out.

Please help me, this is very urgent.