How could I alter this code so that it works onPress?
var ranSound = new Sound(this);
ranSound.onPress = function() {
if (Key.isDown(Key.SPACE)) {
this.stop();
this.attachSound("s"+Math.round(Math.random()*11));
this.start();
}
};
Key.addListener(ranSound);