get the raw data of mp3 file which is downloading with the `Sound` object

Viewed 645

I have dynamically created Sound object

var     files:Object={};
files["file1"]={};
files["file1"]["snd"]=new Sound();
...... //url etc
files["file1"]["snd"].addEventListener(ProgressEvent.PROGRESS, onLoadProgress); 

function onLoadProgress(event:ProgressEvent):void 
//// somehow I need to get the raw data (first 48 bytes to be exact) of the mp3 file which is downloading now
}

I tried URLRequest in that fuction

var myByteArray:ByteArray = URLLoader(event.target).data as ByteArray;

but with no success

It's just funny that such a simple thing as the file data is so hard to get

1 Answers
Related