# Disable buttons from MX to version 5 script

**URL:** <https://forum.kirupa.com/t/disable-buttons-from-mx-to-version-5-script/30378>\
**Category:** Uncategorized\
**Created:** [September 8, 2003, 12:34am UTC](https://forum.kirupa.com/t/disable-buttons-from-mx-to-version-5-script/30378 "2003-09-08T00:34:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trevorsaint](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/trevorsaint/32/268_2.png) [@trevorsaint](https://forum.kirupa.com/u/trevorsaint)\
**Post date:** [September 8, 2003, 12:34am UTC](https://forum.kirupa.com/t/disable-buttons-from-mx-to-version-5-script/30378/1 "2003-09-08T00:34:11Z")

</div>

I have been using this script in the main timeline to disable buttons except I require my flash for flash 5, and the script no longer works, does anyone know of an alternative method for disable buttons until a desired frame?

current action script is

[AS]

MovieClip.prototype.enableButton = function() {  
for (var name in this) {  
if (this[name] instanceof MovieClip) {  
this[name].enableButton(arguments[0]);  
} else if (this[name] instanceof Button) {  
this[name].enabled = arguments[0];  
}  
}  
};  
navigationBar.onEnterFrame = function() {  
this.\_currentframe == this.\_totalframes ? this.enableButton(true) : this.enableButton(false);  
};

[/AS]

thank you 🙂
