Where are you stumped?

I take it you have a movieclip on a frame somewhere named "nextButton".

In the actions for that frame, put the code above. Name your frames appropriately.