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

**URL:** <https://forum.kirupa.com/t/what-would-check-to-see-what-frame-im-on/315679>\
**Category:** flash\
**Created:** [November 1, 2010, 6:29pm UTC](https://forum.kirupa.com/t/what-would-check-to-see-what-frame-im-on/315679 "2010-11-01T18:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thrillhou](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@Thrillhou](https://forum.kirupa.com/u/Thrillhou)\
**Post date:** [November 1, 2010, 6:29pm UTC](https://forum.kirupa.com/t/what-would-check-to-see-what-frame-im-on/315679/1 "2010-11-01T18:29:51Z")

</div>

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”);  
}
