# If Else Complex button

**URL:** <https://forum.kirupa.com/t/if-else-complex-button/269599>\
**Category:** flash\
**Created:** [August 29, 2008, 11:00am UTC](https://forum.kirupa.com/t/if-else-complex-button/269599 "2008-08-29T11:00:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![beet](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@beet](https://forum.kirupa.com/u/beet)\
**Post date:** [August 29, 2008, 11:00am UTC](https://forum.kirupa.com/t/if-else-complex-button/269599/1 "2008-08-29T11:00:13Z")

</div>

Hello Geniuses

I’m having some trouble with a movie clip button. Basically I have a button that when you click it it sends you to another frame on the root timeline. This all works fine, however I want the button to stay in it’s transformed state whilst you are in the specific root timeline frame, therefore signifying where you are on the site. Here’s the code I have used -

stop();  
this.onEnterFrame = function(){  
if(rewind == true){  
prevFrame();  
}  
}

this.onRollOver = function(){  
rewind = false;  
play();  
}

this.onRollOut = function(){  
rewind = true;  
}

I cannot figure out how to code the next bit. I think I need to use an if/ else statement but am not sure howm I have read loads of posts but cannot translate them to my needs. I have had a guess at something like this (without success -

this.if(\_root 19 == true){  
\_parent.gotoAndStop(4);  
}

Any advice would be much appreciated!

Beet
