4 Replies Latest reply on Aug 13, 2009 3:39 AM by Sreelash

    Scrubber issue. AS 2, Flash CS 3


      Hey there. After following the scrubber tutorial on gotoandlearn I've hit a serious hick-up. Basically instead of scrubbing, if I grab and move my "scrub" it literally just pauses the video, and once I've let go, returns to the beginning?

      I've narrowed the problem down to the "scrubit" function and the script for that function but unfortunately can't seem to solve it. Any help out there?


      Here's the whole code:


      var videoInterval = setInterval(videoStatus,100);
      var amountLoaded:Number;
      var duration:Number;


      ns["onMetaData"] = function(obj)
          duration = obj.duration;


      function videoStatus()
          amountLoaded = ns.bytesLoaded / ns.bytesTotal;
          loader.loadbar._width = amountLoaded * 338;
          loader.scrub._x = ns.time / duration * 338;


      var scrubInterval;


      loader.scrub.onPress = function()
          scrubInterval = setInterval(scrubit,10);


      loader.scrub.onRelease = loader.scrub.onReleaseOutside = function()
          videoInterval = setInterval(videoStatus,100);


      function scrubit()
          ns.seek(Math.floor(loader.scrub._x/336.6) * duration);


      In bold is what I think the problem is.


      Any help, comments are much appreciated.