PDA

View Full Version : How's This Possible??


DigitalNexus
11-12-2009, 11:47 PM
I'm preloading an mp3 file that is 4 MB in size. When I test the preloder, it loads almost instantaneously...(yes, I'm simulating a download in flash, very low download speed as well. At 28k it only takes a few seconds to load

However, when I preload my .swf file that is only 900kb, it takes around four times longer.

I have my audio set at high quality and 160kb in the publish settings.

Can someone explain how the audio is downloading so quickly?

Here is my code (got it from Flep)

var soundReq:URLRequest = new URLRequest("song.mp3")
var sound:Sound = new Sound();
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
sound.addEventListener(ProgressEvent.PROGRESS, progressHandler);
function progressHandler(event:ProgressEvent):void
{
var perc:int=Math.round(event.bytesLoaded/event.bytesTotal*100);
percent.text=Math.round(perc).toString();
trace(perc);
}
function onComplete(event:Event):void
{
trace('download complete');
}

tean28
11-13-2009, 04:14 AM
for audio and video you have to download from the web, otherwise download is instantaneous.