Skip to main content
Inspiring
January 9, 2008
Answered

sound position and duration

  • January 9, 2008
  • 1 reply
  • 261 views
The sounds come from an array, when I click on the sound icon a new mp3 is loaded, that part works. The problem is with the txtPlayTime.text, when I load a new mp3 soundPlayingTime does not initialize from 00:00 but continues counting and the content of the text field txtPlayTime.text bliks from 00:00 / 00:00 to the current value every time the interval refreshes.

I tried all kind of things but I cannot make it work properly. Any help will be appreciated.

Thank you in advanced,


This topic has been closed for replies.
Correct answer cfortin14
This is the final working code, thank you niki!

1 reply

Inspiring
January 10, 2008
So i have the same problem and i decide when i setInterval into the object.onLoad=function so try with this

mySound.onLoad=function(success)
{
sound_interval = setInterval(updateSoundProgress, 100, s);
if(success)
{
mySound.start(mySound.position/1000);
}
}
and put command into your buttons
mySound.stop();
mySound.start(0);
cfortin14AuthorCorrect answer
Inspiring
January 11, 2008
This is the final working code, thank you niki!
Inspiring
January 11, 2008
U welcome.
I have question are you upload ur project into server and test it? Because when i write my player i was problem in onLoad=function(success) i mean user open the site and sound play but after the sound loaded that mean if(success) i put like you s.stop() s.start(0) the current sound stop and begin from 0 , it dousent continue from the current position i decide with s.start(s.position/1000).I offer u to test your player into some server :)