0 Replies Latest reply on Nov 22, 2006 11:15 AM by rsterling

    Can you help me please??

    rsterling
      Problem: Erratic Scrubber behavior

      Sample: http://revision3.com/diggnation/2006-11-09

      Symptoms: Scrubber jumps too far ahead or behind of where user clicks and will not seek backwards very well or at all.

      Replicate Problem: Allow video to load for a couple minutes. Then click around at various times in the movie.

      Notes: Problems cease to exist when scrubbing a fully downloaded FLV

      Sample code: (Snipets from parts that I think apply)

      //-------NETCONNECTION SETUP--place server address in (null)
      var nc:NetConnection = new NetConnection ();
      nc. connect (null);


      //-------NETSTREAM SETUP------------------------------------
      var ns:NetStream = new NetStream (nc);


      ns.onStatus = function(info) {
      if(info.code =="NetStream.Play.Start") {
      progressBar.onEnterFrame = videoUpdate;
      }
      if(info.code =="NetStream.Play.Stop") {
      delete progressBar.onEnterFrame;
      }
      }

      ns.onMetaData = function(info) {
      ns.duration = info.duration;
      }

      //-------LOADBAR-------------------------------------------
      loadbar.onEnterFrame = function() {
      this._xscale = (ns.bytesLoaded/ns.bytesTotal) *100;
      if(this._xscale == 100) {
      delete this.onEnterFrame;
      }
      }

      //-------VIDEO UPDATE---------------------------------------
      function videoUpdate() {
      progressBar._xscale = (ns.time/ns.duration)*100;
      timecode.text = getTimecode(ns.time);
      }

      //-------VIDEO SCRUBBER-------------------------------------
      loadbar.onPress = function() {
      progressBar.onEnterFrame = videoScrub;
      }

      loadbar.onRelease = loadbar.onReleaseOutside = function() {
      progressBar.onEnterFrame = videoUpdate;
      }


      function videoScrub() {
      var dist:Number = (_root._xmouse-loadbar._x)/loadbar._width;
      ns.seek(Math.floor(ns.duration*dist));
      progressBar._xscale = (ns.time/ns.duration)*100;
      timecode.text = getTimecode(ns.time);
      }

      -------------------------------------------------------

      Any ideas? It would be much appreciated.