(mx) I’m trying to make an audio progress bar. I’d like any help that can be given to help me accomplish this. I’m loading the songs externally when it is selected. I just need a bar to represent the song being loaded. I’m loading the songs from .mp3s
track1= new Sound
track1.loadSound(“morning.mp3”,false);
all= track1.getBytesTotal();
bytes_loaded = Math.round(track1.getBytesLoaded());
getPercent = bytes_loaded/all;
this.loadBar._width = getPercent100;
this.loadText = Math.round(getPercent 100)+"%";
if(bytes_loaded/all >=.59){
gotoAndPlay(3);
}
the loadBar is the name of the progress bar_mc…this is the script I’m using, but I’d scrap it for a script that works…
system
July 18, 2003, 4:18pm
2
um…
Keep track, or better yet, find out how long each song is, preferably in milliseconds.
start a timer as soon as the song starts
divide (2)/(1) multiply it by 100, and you’ve got your progress percentage.
apply this to an object using their _xscale/_yscale (optional) bar. set (3) equal to the objects scale and you’ve got your progress bar.
This works very much the same as preloaders, which seem to be such a problem for everybody…
system
July 18, 2003, 4:51pm
3
thanks for the advice, but how would I make the timer…the beginning is no problem.
system
July 18, 2003, 5:03pm
4
I’m loading the songs from mp3s
system
July 18, 2003, 5:25pm
5
Flash 6 has the SoundObj .position and SoundObj .duration commands, so you could try those…
system
July 18, 2003, 5:32pm
6
thanks pissant…I’ll check them out, I know you can divide them