Kod: Zaznacz cały
var mojDzwiek1 = new Sound();
mojDzwiek1.attachSound("nuta1");
mojDzwiek1.onSoundComplete = function() {
this.start();
};
var mojDzwiek2 = new Sound();
mojDzwiek2.attachSound("nuta2");
mojDzwiek2.onSoundComplete = function() {
this.start();
};
mojDzwiek1.start();
nuta1.onRelease = function() {
mojDzwiek2.stop();
mojDzwiek1.start();
};
nuta2.onRelease = function() {
mojDzwiek1.stop();
mojDzwiek2.start();
};
var pos = 0;
mojDzwiek1.isPlaying = true
on_off.onRelease = function(){
with(mojDzwiek1){
isPlaying ? stop() : start(pos,1024);
isPlaying = !isPlaying
}
}
