Hello again…
I need some help with creating a progress bar for a mp3 player that loads mp3s with loadSound()
The problem is that the progress bar is not working correctly while the music is streaming (not completely downloaded to cache).
I can understand why it is so… (sound.duration is changing untill download is complete)
I have a simple progress bar… no masking etc:- … just using the good old “_xscale”
now how to correct the problem… please advice…
please
But this will show the loaded percentage i want the progress bar to show the current position percentage, because later this will be used as a seek bar as well
[quote=vamsig;2323505]Hello Friend,
I think it will help full for you… Please the following code… If in case you get any problem let me know…
var mysound:Sound = new Sound();
mysound.loadSound(“audio name”);
var lod:Number = mysound.getBytesLoaded();
var total:Number = mysound.getBytesTotal();
per = (lod/total)*100;
progressbar._xscale = per;[/quote]
You have to use the same logic but replace mysound.getBytesTotal(); by mysound.duration; and mysound.getBytesLoaded(); by mysound.position;.
Check Sound class on flash help.