Caution: try to avoid giving the names, button[1], button[2], since they refer to array elements, instead you can use button1, button2.
Please try this code giving values 0, and 1 to the variable cnt, respectively.
Code:
var cnt=0;
if(cnt==0){
button1.enabled = true;
button2.enabled = false;
}
if(cnt==1){
button1.enabled = false;
button2.enabled = true;
}
button1.onRelease = function() {
trace( "you clicked : " + this._name );
}
button2.onRelease = function() {
trace( "you clicked : " + this._name );
}