Loading Sound with URLLoader

I am loading a sound file with the URLLoader class passed to the URLRequest class, just as one would load any other external content type.

var loader:URLLoader=new URLLoader;
loader.load(new URLRequest("file.mp3"));

When the loading is complete I would like to pass the data to a Sound Object.

var mySound:Sound=e.currentTarget.data

The object returned on the complete event is of type flash.net::URLLoader.

e.currentTarget

How can I turn this URLLoader into a Sound Object?

Any help would be greatly appreciated.

Thanks.

Old topic, but the solution would be to change your data format for loading to binary with:

loader.dataFormat = URLLoaderDataFormat.BINARY;

Then when the loading is complete you should use the loadCompressedDataFromByteArray method like this:

var sound:Sound = new Sound();
sound.loadCompressedDataFromByteArray(event.target.data,event.target.data.length);