1 Reply Latest reply on Jan 9, 2008 11:59 AM by mgk132

    flash video: display elapsed time

    patmck47
      I am using the FLVPlayback component and one of the video templates from this site that uses screens. I want to display elapsed time/total time. I can't find a script to do that although i do find some if you don't use the FLVPlayback component.

      any help would be much appreciated.
        • 1. Re: flash video: display elapsed time
          mgk132 Level 1
          Hey Pat, I'm using something like this. You need to place the time() function on frame 1 and place the bottom code in an event or on a frame loop (while the video plays)

          // assumes the FLV Playback component with an instance name - VideoPlayer

          // time fiunction converts seconds to actual time
          function time($seconds) {
          if ($seconds !="Z") {
          var $time:Number = $seconds;
          var $min:Number = Math.floor($time/60);
          //var $hrs:Number = Math.floor($min % 60);
          var $sec:Number = $time % 60;
          if ($sec <10 ) {
          var $sec:String = "0"+$sec;
          }
          if ($min < 1 ) {
          var $min:String = "";
          }
          var $timing:String = $min + ":" + $sec;
          } else {
          var $timing:String="";
          }
          return $timing;
          }

          // displays in a textfield- VidTime
          VidTime.text = time(Math.floor(VideoPlayer.playheadTime))+" of "+time(Math.floor(VideoPlayer.totalTime));