var PlaySound:Boolean=false; MyButton.onPress=function(){ if(playSound){ MySound.stop(); }else{ MySound.start(); } PlaySound=!PlaySound; }