I'm in the process of creating a video control for a swf
video. I'm trying to work out a way to display the total duration
of the video and the current play time. So far I have worked out
the total time by using _root._totalframes / framerate (12fps) /60
to give me the duration in minutes. What I'm having problems with
is using the same method but with the _currentframe to work out the
current playtime of the video. I can get the minutes to display
properly using the Math.floor function but I have been unable to
get the correct display of the seconds. Clear as mud??!
For example say my video has a total duration of 2 mins and
36 seconds. I want the playtime to update whilst the movie is
playing until it reached the total durations.....1:46 of 2:36 etc.
instead of dividing by 60 to change your total time from
seconds to fractional minutes (and then rounding), just pass your
total seconds to the function below. it will return the time in the
format you want: