Update DefaultAssetLibrary.hx

This commit is contained in:
srevid
2015-03-02 15:30:00 -05:00
parent 0c56683ff5
commit 2412d6aceb

View File

@@ -422,26 +422,24 @@ class DefaultAssetLibrary extends AssetLibrary {
public override function loadAudioBuffer (id:String, handler:AudioBuffer -> Void):Void {
#if (flash || js)
#if (flash)
if (path.exists (id)) {
//if (path.exists (id)) {
var soundLoader = new Sound ();
soundLoader.addEventListener (Event.COMPLETE, function (event) {
// var loader = new Loader ();
// loader.contentLoaderInfo.addEventListener (Event.COMPLETE, function (event) {
var audioBuffer:AudioBuffer = new AudioBuffer();
audioBuffer.src = event.currentTarget;
handler (audioBuffer);
// handler (cast (event.currentTarget.content, Bitmap).bitmapData);
// });
// loader.load (new URLRequest (path.get (id)));
//} else {
});
soundLoader.load (new URLRequest (path.get (id)));
} else {
handler (getAudioBuffer (id));
//}
}
#else
handler (getAudioBuffer (id));
#end