# Detect if on frame

**URL:** <https://forum.kirupa.com/t/detect-if-on-frame/49140>\
**Category:** flash\
**Created:** [April 20, 2004, 7:53am UTC](https://forum.kirupa.com/t/detect-if-on-frame/49140 "2004-04-20T07:53:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voursez](https://avatars.discourse-cdn.com/v4/letter/v/b5ac83/32.png) [@Voursez](https://forum.kirupa.com/u/Voursez)\
**Post date:** [April 20, 2004, 7:53am UTC](https://forum.kirupa.com/t/detect-if-on-frame/49140/1 "2004-04-20T07:53:32Z")

</div>

Hi people, i have a problem with some buttons for a CD im making. Ive made a movieclip play, when i press the button, to show people which page they are on, and when i press another button a new MC will paly, and the old one will play back. So its like on button 1:

[AS]on(rollOver){gotoAndPlay(2);}  
on(rollOut){gotoAndPlay(11);}  
on(dragOut){gotoAndPlay(11);}  
on(press){\_root.button\_ani\_this.gotoAndPlay(2);  
\_root.button\_ani\_that.gotoAndPlay(11);}[/AS]

And on button 2:

[AS]on(rollOver){gotoAndPlay(2);}  
on(rollOut){gotoAndPlay(11);}  
on(dragOut){gotoAndPlay(11);}  
on(press){\_root.button\_ani\_that.gotoAndPlay(2);  
\_root.button\_ani\_this.gotoAndPlay(11);}[/AS]

Maybe you can see what the problem is. It works well if i only have 2 buttons. But over that, when i press one of my buttons, the other’s MC, will still play back, even though they are not out. So i need some sort of an if-else command, that checks if the button MC’s is on a special frame.

If i didnt explain well enough, maybe my .fla can help: [http://voursez.net/lo2face.fla](http://voursez.net/lo2face.fla)
