Moving through frames using Document class

Hi guys,

I have a flash file with a couple of frames.

I want to move between them using the Document class.

eg. I have a button on Frame1. When that button is clicked, I want to go to Frame2.

I can do this using the built in ActionScript editor using gotoAndStop (), but if I try to do this using a Document class, I’m unable to do it.

I have searched the Net in vain. Can one of you pros help me?

Thanks!