I am getting the result for event.bytesTotal = 0
in some of the mp3 file when i am loading it from ftp server.But
when loading the same file from local server, the call to event.bytesTotal
is working well - giving the expected result.
Here is my code :
public function LoadedBytes()
{
var byteLoader:URLLoader = new URLLoader();
byteLoader.dataFormat = URLLoaderDataFormat.BINARY;
var fileRequest:URLRequest = new URLRequest();
myFile =new File();
myFile=File.desktopDirectory;
myFileStream = new FileStream();
fileRequest.url="http://minhajproductions.in/irfanulquran/Al-Fatihah/4.mp3";
myFile=File.desktopDirectory;
myFile=myFile.resolvePath("sound/4.mp3");
try{
byteLoader.addEventListener(ProgressEvent.PROGRESS,onProgress);
byteLoader.load(fileRequest);
}catch(e:IOError){
trace("unable to load requested sound")
}
}
protected function onProgress(event:ProgressEvent):void
{
trace(event.bytesLoaded,event.bytesTotal," length");
//progressCB((event.bytesLoaded/event.bytesTotal));
}
why this weird thing is happening? Thanks in advance.