View Full Version : Reset sound positon/duration
goody44
08-13-2006, 11:44 PM
Im trying to make a flash mp3 player using the loadSound command and I cant figure out how to make the mysound.position/duration property reset when I change the song thats playing. Also when I go to the next song and then return to the previous song flash has memorised the old position?? How do I stop this?
goody44
08-13-2006, 11:59 PM
The duration that I was receiving was the duration of the part of the sound that was loaded so far. Is there a way to get the duration of the full sound?
XDudedotcom
08-17-2006, 02:27 AM
I also had this problem a while ago, trying to get a sound that had completed to "rewind" to the beginning.
Fix:
function beginSound() {
if (soundIsPlaying="false") {
if (reachedEnd == true) {
my_sound.start(0);
reachedEnd = false;
} else {
my_sound.start(curPos/1000);
}
}
}
This code can be re-used in your "next song" function to set the "playhead" back to zero.
goody44
08-17-2006, 02:52 AM
Sweet thanks, that works great
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.