I have the following code.
I am loading a remote .mp3 file, and it's playing, but I assume it isn't fully loaded when it starts to play (i.e., streaming). As I already know the duration of the track, I'm adding that from an .xml. Then I'm testing for how long the .mp3 has been playing.
playedseconds=Math.floor(this.sound.position/1000); playedtime=Math.floor(playedseconds/60) + ":" + playedseconds%60; trace(playedtime);
and add a setInterval
But the trace just reports
What am I doing wrong?
Did you initialise the variables ie;
No, I hadn't. That's helped. I'm now getting
I tried var 'ing the rest, playtime, totaltime, and totalseconds. It didn't help.
I did. It said playedtime and totaltime were strings, so I changed them.