_root.vr=0; btn.onRelease = function() { if(_root.vr==0) { _root.vr=1; //выполняется действие 1 } else { _root.vr=0; //выполняется действие 2 } }