7 Replies Latest reply on Feb 15, 2011 1:39 PM by kglad

    Flash Help

    flashno0b

      Hello everyone,
      I'm new to flash, so please excuse my ignorance.

       

      I'm making a working scrubber on a video, but having problems. The scrub itself it starting out in the middle of the loadbar. I've looked everywhere, trying to find out what is wrong with it. Any help would be much appreciated.

       

      Here is the code and link to my .fla   
      [url]http://www.fileden.com/files/2010/9/21/2975503//movie%20video.fla[/url]

       

      var nc:NetConnection = new NetConnection();
      nc.connect(null);

       

      var ns:NetStream = new NetStream(nc);

       

      theVideo.attachVideo(ns);

       

      ns.play("greenlantern-tlr2_720p.flv");

       

      rewindbutton.onRelease = function() {
          ns.seek(0);
      }

       

      playbutton.onRelease = function() {
          ns.pause();
         
      }

       

      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 * 800.8;
          loader.scrub._x = ns.time / duration * 800.8;
      }

       

       

       

       

      Thanx


        • 1. Re: Flash Help
          kglad-zqbLf4 Level 3

          :

           


           

          var nc:NetConnection = new NetConnection();
          nc.connect(null);

           

          var ns:NetStream = new NetStream(nc);

           

          theVideo.attachVideo(ns);

           

          ns.play("greenlantern-tlr2_720p.flv");

           

          rewindbutton.onRelease = function() {
              ns.seek(0);
          }

           

          playbutton.onRelease = function() {
              ns.pause();
             
          }

           

          var videoInterval:Number;
          var amountLoaded:Number;
          var duration:Number;

           

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

          videoInterval = setInterval(videoStatus,100);


          }

           

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

           

           

           

           

           


          flashno0b wrote:

           

          Hello everyone,
          I'm new to flash, so please excuse my ignorance.

           

          I'm making a working scrubber on a video, but having problems. The scrub itself it starting out in the middle of the loadbar. I've looked everywhere, trying to find out what is wrong with it. Any help would be much appreciated.

           

          Here is the code and link to my .fla   
          [url]http://www.fileden.com/files/2010/9/21/2975503//movie%20video.fla[/url]

           

          var nc:NetConnection = new NetConnection();
          nc.connect(null);

           

          var ns:NetStream = new NetStream(nc);

           

          theVideo.attachVideo(ns);

           

          ns.play("greenlantern-tlr2_720p.flv");

           

          rewindbutton.onRelease = function() {
              ns.seek(0);
          }

           

          playbutton.onRelease = function() {
              ns.pause();
             
          }

           

          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 * 800.8;
              loader.scrub._x = ns.time / duration * 800.8;
          }

           

           

           

           

          Thanx


          • 2. Re: Flash Help
            flashno0b Level 1

            This didn't help me any.

            • 3. Re: Flash Help
              kglad-zqbLf4 Level 3

              what's the following show:

               

               

              var nc:NetConnection = new NetConnection();
              nc.connect(null);

               

              var ns:NetStream = new NetStream(nc);

               

              theVideo.attachVideo(ns);

               

              ns.play("greenlantern-tlr2_720p.flv");

               

              rewindbutton.onRelease = function() {
                  ns.seek(0);
              }

               

              playbutton.onRelease = function() {
                  ns.pause();
                 
              }

               

              var videoInterval:Number;
              var amountLoaded:Number;
              var duration:Number;

               

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

              videoInterval = setInterval(videoStatus,100);


              }

               

              function videoStatus() {

              trace(loader+" "+loader.scrub+" "+ns.time+" "+duration);
                  amountLoaded = ns.bytesLoaded / ns.bytesTotal;
                  loader.loadbar._width = amountLoaded * 800.8;
                  loader.scrub._x = ns.time / duration * 800.8;
              }

              • 4. Re: Flash Help
                flashno0b Level 1

                Yes, I seen what you did, just move that code underneath. But I have no idea what you are trying to say, I am very new to this.

                • 5. Re: Flash Help
                  kglad-zqbLf4 Level 3

                  copy the code i suggested and paste the code i suggested into your fla replacing your code.  click control/test movie.  there will be text written to your output panel.  copy that text and paste it into your next forum message.

                  • 6. Re: Flash Help
                    flashno0b Level 1

                    _level0.loader _level0.loader.scrub 0.235 148.189
                    _level0.loader _level0.loader.scrub 0.287 148.189
                    _level0.loader _level0.loader.scrub 0.365 148.189
                    _level0.loader _level0.loader.scrub 0.47 148.189
                    _level0.loader _level0.loader.scrub 0.522 148.189
                    _level0.loader _level0.loader.scrub 0.705 148.189
                    _level0.loader _level0.loader.scrub 0.783 148.189
                    _level0.loader _level0.loader.scrub 0.888 148.189
                    _level0.loader _level0.loader.scrub 0.888 148.189
                    _level0.loader _level0.loader.scrub 0.992 148.189
                    _level0.loader _level0.loader.scrub 1.201 148.189
                    _level0.loader _level0.loader.scrub 1.306 148.189
                    _level0.loader _level0.loader.scrub 1.306 148.189
                    _level0.loader _level0.loader.scrub 1.306 148.189
                    _level0.loader _level0.loader.scrub 1.541 148.189
                    _level0.loader _level0.loader.scrub 1.724 148.189
                    _level0.loader _level0.loader.scrub 1.776 148.189
                    _level0.loader _level0.loader.scrub 1.854 148.189
                    _level0.loader _level0.loader.scrub 1.959 148.189
                    _level0.loader _level0.loader.scrub 2.037 148.189
                    _level0.loader _level0.loader.scrub 2.089 148.189
                    _level0.loader _level0.loader.scrub 2.272 148.189
                    _level0.loader _level0.loader.scrub 2.377 148.189
                    _level0.loader _level0.loader.scrub 2.429 148.189
                    _level0.loader _level0.loader.scrub 2.429 148.189
                    _level0.loader _level0.loader.scrub 2.69 148.189
                    _level0.loader _level0.loader.scrub 2.795 148.189
                    _level0.loader _level0.loader.scrub 2.873 148.189
                    _level0.loader _level0.loader.scrub 2.977 148.189
                    _level0.loader _level0.loader.scrub 2.977 148.189
                    _level0.loader _level0.loader.scrub 3.213 148.189
                    _level0.loader _level0.loader.scrub 3.291 148.189
                    _level0.loader _level0.loader.scrub 3.395 148.189
                    _level0.loader _level0.loader.scrub 3.395 148.189
                    _level0.loader _level0.loader.scrub 3.631 148.189
                    _level0.loader _level0.loader.scrub 3.709 148.189
                    _level0.loader _level0.loader.scrub 3.761 148.189
                    _level0.loader _level0.loader.scrub 3.866 148.189
                    _level0.loader _level0.loader.scrub 3.944 148.189
                    _level0.loader _level0.loader.scrub 4.048 148.189
                    _level0.loader _level0.loader.scrub 4.179 148.189
                    _level0.loader _level0.loader.scrub 4.179 148.189
                    _level0.loader _level0.loader.scrub 4.362 148.189
                    _level0.loader _level0.loader.scrub 4.466 148.189
                    _level0.loader _level0.loader.scrub 4.597 148.189
                    _level0.loader _level0.loader.scrub 4.702 148.189
                    _level0.loader _level0.loader.scrub 4.78 148.189
                    _level0.loader _level0.loader.scrub 4.884 148.189
                    _level0.loader _level0.loader.scrub 4.963 148.189
                    _level0.loader _level0.loader.scrub 4.963 148.189
                    _level0.loader _level0.loader.scrub 5.198 148.189
                    _level0.loader _level0.loader.scrub 5.302 148.189
                    _level0.loader _level0.loader.scrub 5.381 148.189
                    _level0.loader _level0.loader.scrub 5.381 148.189
                    _level0.loader _level0.loader.scrub 5.616 148.189
                    _level0.loader _level0.loader.scrub 5.72 148.189
                    _level0.loader _level0.loader.scrub 5.773 148.189
                    _level0.loader _level0.loader.scrub 5.773 148.189
                    _level0.loader _level0.loader.scrub 5.955 148.189
                    _level0.loader _level0.loader.scrub 6.034 148.189
                    _level0.loader _level0.loader.scrub 6.217 148.189
                    _level0.loader _level0.loader.scrub 6.217 148.189
                    _level0.loader _level0.loader.scrub 6.217 148.189
                    _level0.loader _level0.loader.scrub 6.452 148.189
                    _level0.loader _level0.loader.scrub 6.635 148.189
                    _level0.loader _level0.loader.scrub 6.635 148.189
                    _level0.loader _level0.loader.scrub 6.791 148.189
                    _level0.loader _level0.loader.scrub 6.87 148.189
                    _level0.loader _level0.loader.scrub 6.974 148.189
                    _level0.loader _level0.loader.scrub 7.053 148.189
                    _level0.loader _level0.loader.scrub 7.209 148.189
                    _level0.loader _level0.loader.scrub 7.288 148.189
                    _level0.loader _level0.loader.scrub 7.392 148.189
                    _level0.loader _level0.loader.scrub 7.471 148.189
                    _level0.loader _level0.loader.scrub 7.627 148.189
                    _level0.loader _level0.loader.scrub 7.706 148.189
                    _level0.loader _level0.loader.scrub 7.81 148.189
                    _level0.loader _level0.loader.scrub 7.862 148.189
                    _level0.loader _level0.loader.scrub 7.862 148.189
                    _level0.loader _level0.loader.scrub 8.045 148.189
                    _level0.loader _level0.loader.scrub 8.228 148.189
                    _level0.loader _level0.loader.scrub 8.306 148.189
                    _level0.loader _level0.loader.scrub 8.306 148.189
                    _level0.loader _level0.loader.scrub 8.463 148.189

                    • 7. Re: Flash Help
                      kglad Adobe Community Professional & MVP

                      so, your code is working correctly.  what problem do you see?


                      1 person found this helpful