Using ActionScript to get timecode information

Flash Media Live Encoder contains a special built-in handler, onFI, that subscribing clients can use in their ActionScript code to access timecode information. The following client-side ActionScript code shows how to get timecode information using the onFI handler. The object ns is the NetStream object. You can get timecode and system date and time information, if timecode and system date and time were embedded in the stream, by accessing the tc, sd, and st properties of the info object that is passed as an argument to onFI():

ns.onFI = function(infoObj){ 
    var timecode:String; // Timecode generated by capture device 
    var systemDate:String; // System date "sd" embedded by Flash Media Live Encoder 
    var systemTime:String; // System time "st"embedded by Flash Media Live Encoder 
 
    for( i in infoObj) 
        { 
            if(i == "tc") 
            timecode = infoObj.tc; //string formatted hh:mm:ss:ff 
        } 
        { 
            if(i == "sd") 
            systemDate = infoObj.sd //string formatted as dd-mm-yy 
        } 
        { 
            if(i == "st") 
            systemTime = infoObj.st //string formatted as hh:mm:ss.ms 
        } 
}