# Disable button if on a frame

**URL:** <https://forum.kirupa.com/t/disable-button-if-on-a-frame/315442>\
**Category:** flash\
**Created:** [October 26, 2010, 8:22am UTC](https://forum.kirupa.com/t/disable-button-if-on-a-frame/315442 "2010-10-26T08:22:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_Mo](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@J\_Mo](https://forum.kirupa.com/u/J_Mo)\
**Post date:** [October 26, 2010, 8:22am UTC](https://forum.kirupa.com/t/disable-button-if-on-a-frame/315442/1 "2010-10-26T08:22:45Z")

</div>

Hi,

I have created a series of buttons which are actually MCs in AS3. Each button when clicked goes to a particular frame (all good). The problem that occurs is when you click a button that is ‘active’ (ie click a button twice in a row)…Flash takes you to the next frame rather than keeping you on the designated frame.

How can I stop this or disable the button whilst on its designated frame?

```auto
if(mymovieClip.currentFrame == 'myFrame') {

DONT DO ANYTHING!

} else {
gotoAndPlay('myFrame');
}

```

Thanks  
Phil
