# Help making button work according to frame

**URL:** https://forum.kirupa.com/t/help-making-button-work-according-to-frame/176716
**Category:** flash
**Created:** [January 26, 2006, 10:34am UTC](https://forum.kirupa.com/t/help-making-button-work-according-to-frame/176716 "2006-01-26T10:34:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![spxy](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@spxy](https://forum.kirupa.com/u/spxy)
#### Post date: [January 26, 2006, 10:34am UTC](https://forum.kirupa.com/t/help-making-button-work-according-to-frame/176716/1 "2006-01-26T10:34:15Z")

</div>

Hi Guys I’m making a button operate with this code:  
stop();  
this.onEnterFrame = function() {  
if (rewind == true) {  
prevFrame();  
}  
};  
this.onRollOver = function() {  
rewind = false;  
play();  
};  
this.onRollOut = function() {  
rewind = true;  
};  
this.onRelease = function() {  
with (\_root) {  
play();  
}  
};  
What I need to do is make this only work, if the root is on a certain frame, say frame 1, and stop the button from working on other frames, but still be visable.  
can anyone help?
