Browse Source

Audio: Fixed load().

Mr.doob 9 years ago
parent
commit
9e21864f54
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/audio/Audio.js

+ 2 - 1
src/audio/Audio.js

@@ -42,9 +42,10 @@ THREE.Audio.prototype.load = function ( file ) {
 	console.warn( 'THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.' );
 	console.warn( 'THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.' );
 
 
 	var audioLoader = new THREE.AudioLoader( this.context );
 	var audioLoader = new THREE.AudioLoader( this.context );
+	var scope = this;
 
 
 	audioLoader.load( file, function ( buffer ) {
 	audioLoader.load( file, function ( buffer ) {
-		this.setBuffer( buffer );
+		scope.setBuffer( buffer );
 	});
 	});
 
 
 	return this;
 	return this;