|
-
Sound Duration Bar Question, PLEASE HELP :)
i have made an mp3 player that loads mp3s from a dir on my server and streams them. i made a duration bar (duration_mc) to show how much of the song has elaped:
duration_mc.onEnterFrame = function(duration){
this._xscale=my_sound.position/my_sound.duration*100;
it works for the first song, but then when you click another track it will continue from where it left off on the previous song.
my question is, how can i make the duration bar reset to the beginning when you click to stream another song?
-
the problem is that flash does not reset the position property to 0 when you restart the sound object. Even though position is a millisecond value, flash does not update it every ms. It also seems to get stuck on the last position value when you restart the sound.
It will eventually reset itself to a value near the beginning after the sound starts, but when it actually does this seems inconsistent and the value will be the ms position at whatever time the player updates the position property value.
So you may need to set up a loop that waits to read the second value of the position property after you start the sound.
Or you could try deleting the sound object, create a new one, assign a new sound and the new sound object should have a position property value of 0.
-
ya i was trying to assign the duration bar a value of 0, then run the code provided, but that didn't work.
i have seen this work before on a couple players, maybe there is another way to make a progress bar?
ideas?
thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|