7 Replies Latest reply on Dec 3, 2009 1:48 PM by kglad

    How to update NetStream.time during scrub?

    boddingtons34

      Hello,

       

      Just want to throw this out first that I am very new to ActionScript.  I am trying to integrate Omniture tracking with a custom Flash player.  Here is my dilema.

       

      I have this function which populates the "currentVideotime" variable with the current time in the video:

       

      function videoStatus() {
          amountLoaded = ns.bytesLoaded / ns.bytesTotal;
          if(initialized == "yes"){
              controllbar_mc.loadbar.loadprogress._xscale  = amountLoaded * controlload_width;
          }
          controllbar_mc.scrubhandle_mc._x = ns.time / duration * controlload_width;   
          currentVideotime = Math.round(ns.time);   
          //trace(currentVideotime);
          videotime = (Math.round(ns.time));
          mediaLength = Math.floor(duration);
          videolength = (Math.round(mediaLength));
          controllbar_mc.duration.text = getDuration(duration);
          nextvideoNum = currentvideoNum + 1;
         
          omniChecktime(videotime);
          //-- update the progressbar and time codes
          controllbar_mc.progressBar._xscale = ns.time/duration * 100;
          controllbar_mc.timecode.text = getTimecode(ns.time);
         
      }

       

      I have a Slider bar/scrubber in my player.  When I invoke the .onRelease event from jumping ahead in the video the currentVideotime does not update during the scrub.  It only updates after the .onRelease function has completed.  You can see here that witihn the .onRelease event I am calling the above videoStatus function to get the new currentVideotime but is does not update.  Any ideas on how I can get currentVideotime to update when I am in the .onRelease event?

       

      controllbar_mc.scrubhandle_mc.onRelease = loader.scrub.onReleaseOutside = function() {
          clearInterval(scrubInterval);
          videoInterval = setInterval(videoStatus,100);
          this.stopDrag();
          trace("scrubhandle release")
          //if (ns.pause == false){
              omniPlaymovie();
          //}
      }

       

      Many thanks,

      James