0 Replies Latest reply on Apr 25, 2007 11:11 AM by HCPROD

    Preloading external FLV's

    HCPROD


      So I am trying to preload an external .flv in a .swf. I managed to find this Action Script. Works fine, however it preloads WHILE it's playing the FLV. I want it to preload the entire .flv THEN play the .flv.

      Any advice? THANKS!

      Here is the AS:

      var connection_nc:NetConnection = new NetConnection();
      connection_nc.connect(null);
      var stream_ns:NetStream = new NetStream(connection_nc);
      my_video.attachVideo(stream_ns);
      stream_ns.play(" http://lukegasbarro.com/FLV/BISP-01.flv");

      this.createTextField("loadedtext", this.getNextHighestDepth(), 10, 10, 160, 22);
      var loaded_interval:Number = setInterval(checkBytesLoaded, 500, stream_ns);
      function checkBytesLoaded(my_ns:NetStream) {
      var pctLoaded:Number = Math.round(my_ns.bytesLoaded / my_ns.bytesTotal * 100);
      test.loadwork.text = Math.round(my_ns.bytesLoaded / 1000) + " " + pctLoaded + "%";
      progressBar_mc.bar_mc._xscale = pctLoaded;
      if (pctLoaded >= 100) {
      clearInterval(loaded_interval);
      }
      if (pctLoaded >= 100) {
      test._visible = false;
      }

      }

      this.test.loadwork.autoSize = "center";