From d10f37291b3703a7ece68d3d88e099ab47f4fee9 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Wed, 18 Feb 2015 18:25:16 +0100 Subject: [PATCH] check if sounds are downloaded before play thanks @Atlante45 --- examples/libraries/soundArray.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/libraries/soundArray.js b/examples/libraries/soundArray.js index 0da2db07d3..813621fb4b 100644 --- a/examples/libraries/soundArray.js +++ b/examples/libraries/soundArray.js @@ -20,7 +20,9 @@ SoundArray = function(audioOptions, autoUpdateAudioPosition) { if (this.autoUpdateAudioPosition) { this.updateAudioPosition(); } - Audio.playSound(this.sounds[index], this.audioOptions); + if (this.sounds[index].downloaded) { + Audio.playSound(this.sounds[index], this.audioOptions); + } } else { print("[ERROR] libraries/soundArray.js:play() : Index " + index + " out of range."); }