0 Replies Latest reply on May 2, 2007 5:41 AM by Federated Films

    Checking NetStream.time stops my video

    Federated Films Level 1
      I'm using the Flash 8 video object wiht an external On2 VP6 encoded video local to my hard drive and following the code examples in the Help files I can play the video fine, but I want to monitor the video and pause it at a certain timecode. The minute I start to check the netStream.time property the video stops! Is this a known bug?

      My code below.

      playVideo = function (aVideo) {
      // Create a NetConnection object
      var my_nc:NetConnection = new NetConnection();
      // Create a local streaming connection
      my_nc.connect(null);
      // Create a NetStream object and define an onStatus() function
      var my_ns:NetStream = new NetStream(my_nc);
      my_ns.onStatus = function(infoObject:Object):Void {
      trace(infoObject.level)
      trace(infoObject.code)
      if (infoObject.code=="NetStream.Play.Stop"){
      my_ns.close()
      my_video.clear()
      }
      };
      // Attach the NetStream video feed to the Video object
      my_video.attachVideo(my_ns);
      // Set the buffer time
      my_ns.setBufferTime(2);
      // Begin playing the FLV file
      my_ns.play(aVideo);

      var time_interval:Number = setInterval(checkTime, 1000);

      function checkTime() {
      var ns_seconds:Number = my_ns.time;
      trace(ns_seconds)
      }

      };