/ Published in: ActionScript 3
Utile pour formater l'affichage d'un compteur de temps (player video, player mp3, …)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function timeCode(theTime:uint):String { var theMin:uint = Math.floor(theTime / 60); var theSec:uint = theTime % 60; var tcString:String = ""; if (theMin < 10) { tcString += "0"; } if (theMin >= 1) { tcString += theMin.toString(); }else { tcString += "0"; } tcString += ":"; if (theSec < 10) { tcString += "0"; tcString += theSec.toString(); }else { tcString += theSec.toString(); } return tcString; }