HI, Need something like this for AS3 (my player not using netstream)
var listenerObject:Object = new Object();
var _root.fullDuration: null;
listenerObject.metadataReceived = function(eventObject:Object):Void {
_root.fullDuration = _root.prettyTime(flv_playback.metadata.duration);
};
listenerObject.playheadUpdate = function(eventObject:Object):Void {
var paTime = flv_playback.playheadTime;
if(_root.fullDuration != null){
//updates the text box with the instance name timeCode_txt on the root timeline.
//best to use a monospace typeface like calibri for the textbox font.
_root.timeCode_txt.text = _root.prettyTime(flv_playback.playheadTime) + " / " + _root.fullDuration;
}
};
flv_playback.addEventListener(“metadataReceived”, listenerObject);
flv_playback.addEventListener(“playheadUpdate”, listenerObject);
function prettyTime(timeinSeconds):String{
var seconds:Number = Math.floor(timeinSeconds);
var minutes:Number = Math.floor(seconds / 60);
var hours:Number = Math.floor(minutes / 60);
//Storing the remainder of this division problem
seconds %= 60;
minutes %= 60;
hours %= 24;
//Converting numerical values into strings so that
//we string all of these numbers together for the display
var sec:String = seconds.toString();
var min:String = minutes.toString();
var hrs:String = hours.toString();
//Setting up a few restrictions for when the current time reaches a single digit
if (sec.length < 2) {
sec = "0" + sec;
}
if (min.length < 2) {
min = "0" + min;
}
if (hrs.length < 2) {
hrs = "0" + hrs;
}
//Stringing all of the numbers together for the display
var time:String = hrs + ":" + min + ":" + sec;
//Setting the string to the display
return time;
}