# Disable button question

**URL:** <https://forum.kirupa.com/t/disable-button-question/191803>\
**Category:** Uncategorized\
**Created:** [June 23, 2006, 4:06am UTC](https://forum.kirupa.com/t/disable-button-question/191803 "2006-06-23T04:06:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukebattye](https://avatars.discourse-cdn.com/v4/letter/l/9d8465/32.png) [@lukebattye](https://forum.kirupa.com/u/lukebattye)\
**Post date:** [June 23, 2006, 4:06am UTC](https://forum.kirupa.com/t/disable-button-question/191803/1 "2006-06-23T04:06:35Z")

</div>

I have a tab with a rollover effect. The top button calls the tab (called panel) to rolllout which contains another button. I want the original top button to be disabled until the panel has finished playing “out” when the user rolls out of the panel.

Here’s my failing code!

var startTracking = function() {

panel.onEnterFrame = function() {  
if(!hitTest(\_xmouse,\_ymouse,true)) {  
delete this.onEnterFrame;  
this.gotoAndPlay(“out”);  
}  
}  
}

topBtn.onRollOver = function() {  
panel.gotoAndPlay(2);  
startTracking();  
}  
\*\*if (this.panel = (1))  
topBtn.enable = true;  
\*\*  
i think the code needs to say “if panel has not finished playing ‘out’, disable topBtn”  
If you can point out my mistake it would be greatly appreciated.

Thank you
