title: How to play a video while it is loading in Flash AS3?
body: <p>I have a problem in Flash with AS3 to playing a video mp4, this is a H.264 video with AAC, I try to play video while it is loading as any web site, but my code doesn't work, I have two codes:</p>
  
  <ol>
  <li><p>Using FLVPlayback:</p>
  
  <pre><code>var par:Object = LoaderInfo(this.root.loaderInfo).parameters;
  
  //vidRepFla is my FLVPlayback       
  vidRepFla.addEventListener(VideoEvent.READY,vid_ready);
  vidRepFla.addEventListener(VideoProgressEvent.PROGRESS,vid_progress);
  
  vidRepFla.isLive = true;
  vidRepFla.bufferTime = 1;
  
  vidRepFla.play(par.source);
  
  function vid_ready(e:VideoEvent):void{
      trace('Playing!');
      vidRepFla.play();
  }
  
  function vid_progress(e:VideoProgressEvent){
      trace(e.bytesLoaded);
  }   
  </code></pre></li>
  <li><p>Using NetStream:</p>
  
  <pre><code>var par:Object = LoaderInfo(this.root.loaderInfo).parameters;
  var video:Video;
  var connect_nc:NetConnection = new NetConnection(); 
  connect_nc.connect(null);
  var stream_ns:NetStream = new NetStream(connect_nc);
  stream_ns.client = this;
  
  video = new Video();
  addChild(video);    
  
  stream_ns.bufferTime = 1;
  
  video.attachNetStream(stream_ns);
  stream_ns.play(par.source); 
  </code></pre></li>
  </ol>
  
  <p>Do you know if I need something more or if this type video don't work the bufferTime?</p>
  
  <p>Thanks!</p>