delete myButton.onRelease;
myButton.onRelease = null;
myButton.onRelease = function(){ if(flag){ //do smth... } };