summaryrefslogtreecommitdiff
path: root/objects.js
diff options
context:
space:
mode:
Diffstat (limited to 'objects.js')
-rw-r--r--objects.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/objects.js b/objects.js
index 076fc9c..ee53127 100644
--- a/objects.js
+++ b/objects.js
@@ -2617,18 +2617,17 @@ SpriteMorph.prototype.playSound = function (name) {
}
};
-SpriteMorph.prototype.doSetVolume = function(val) {
+SpriteMorph.prototype.doSetVolume = function (val) {
var stage = this.parentThatIsA(StageMorph);
stage.volume = val;
- stage.sounds.asArray().forEach(function (snd) {
- if (snd.audio !== undefined) {
- snd.audio.volume = Math.min(Math.max(0, stage.volume), 100) / 100;
- }
+
+ stage.activeSounds.forEach(function (snd) {
+ snd.volume = Math.min(Math.max(0, stage.volume), 100) / 100; // 'audio' objects
});
};
-SpriteMorph.prototype.reportVolume = function() {
+SpriteMorph.prototype.reportVolume = function () {
var stage = this.parentThatIsA(StageMorph);
return stage.volume;
}