What would check to see what frame I'm on?

I have a problem with a header I’ve been working on. It’s four frames, each loading an external swf into a movieclip, that can be navigated through back and forth using arrow buttons on either side, or autoloads every eight seconds.

The problem is that if a user hits the buttons the actionscript is still hitting the autoload function, causing it to jump back and forth.

I think I need to make a while statement to check if I’m on page one, two, three, or four to put the script in so that it won’t auto run. How would I go about that?

Here’s the code from one of my frames:

loadMovie(“Content/flash1.swf”, containerone);

button1.enabled = false;
button2.enabled = false;

function doTimer() {
button1.enabled = true;
button2.enabled = true;
clearInterval(doTimerID);
}

function doSomething() {
_root.gotoAndStop(“two”);
clearInterval(doSomethingID);
}

doSomethingID = setInterval(doSomething,8000);
doTimerID = setInterval(doTimer,1000);

stop();

and here’s one of the buttons:

on (Release){
_root.clearInterval(_root.doSomethingID);
_root.gotoAndStop(“two”);
}