I'm working on a simple mp3 player application in Flash and am trying to get a time counter implemented that will keep track of how much time has elapsed from the currently playing track. I came across this code snippet online:
var music:Sound = new Sound();
music.loadSound("audio.mp3", true);
var minutes:Number = 0;
var seconds:Number = 0;
this.onEnterFrame = function() {
minutes = Math.floor(music.position / 1000 / 60);
seconds = Math.floor(music.position / 1000) % 60;
output.text = minutes + ":" + seconds;
}
However it seems that the position property is no longer part of the Sound class. I'm new to ActionScript, has this property been moved elsewhere? Or does someone have any thoughts on how to implement a time counter for mp3 progress?
The play method in Sound returns a SoundChannel which has the position property you're looking for.