lib/melonJS-0.9.3.js
/*
		 * ---
		 * 
		 * event listener callback on load error
		 * 
		 * ---
		 */
event listener callback on load error
event listener callback on load error
function soundLoadError(sound_id) {
			if (retry_counter++ > 3) {
				var errmsg = "melonJS: failed loading " + sound_id + "." + activeAudioExt;
				if (me.sys.stopOnAudioError===false) {
					me.audio.disable();
					if (load_cb) {
						load_cb();
					}
					console.log(errmsg + ", disabling audio");
				} else {
					throw errmsg;
				}
			} else {
				audio_channels[sound_id][0].load();
			}
		}
function soundLoadError ( sound_id ) { if ( retry_counter ++ > 3 ) { var errmsg = "melonJS: failed loading " + sound_id + "." + activeAudioExt ; if ( me . sys . stopOnAudioError === false ) { me . audio . disable ( ) ; if ( load_cb ) { load_cb ( ) ; } console . log ( errmsg + ", disabling audio" ) ; } else { throw errmsg ; } } else { audio_channels [ sound_id ] [ 0 ] . load ( ) ; } }
// check the retry counter // something went wrong // disable audio // call load callback if defined // warning // throw an exception and stop everything ! // else try loading again !