title: how do I use netstream.appendBytes() for http dynamic streaming?
body: <p>I am trying to figure out how to use http dynamic streaming with flash 10.1 but I can't get the basic functions working.  What is the syntax for using appendbytes with a video file?</p>
  
  <pre><code>package com.player {
  
  import flash.display.Stage;
  import flash.net.NetConnection;
  import flash.net.NetStream;
  import flash.media.Video;
  import flash.display.Sprite;
  import flash.net.URLRequest;
  import flash.net.URLStream;
  import flash.events.Event;
  import flash.utils.ByteArray;
  
  public class Player extends Sprite {
  
      const vurl = "file://E:/clip.flv"
  
      private var nc:NetConnection;
      private var ns:NetStream;
      private var vo:Video;
  
  
  
      private var urlstream:URLStream;
  
      public function Player() {
  
          nc = new NetConnection();
          nc.connect(null);
  
          ns = new NetStream(nc);
          ns.client = new StreamClient();
  
          vo = new Video();
          vo.attachNetStream(ns);
  
          addChild(vo);
  
          ns.play(vurl);
  
          var urlrequest:URLRequest = new URLRequest(vurl)
           urlstream = new URLStream();
  
          urlstream.addEventListener(Event.COMPLETE, completeHandler);
  
          urlstream.load(urlrequest);
  
  
  
      }
  
      private function completeHandler(event:Event):void {
          trace("completeHandler: " + event);
  
          var bytes:ByteArray = new ByteArray();
  
          urlstream.readBytes(bytes);
  
          ns.appendBytes(bytes);
      }
  
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Running this gives me the error:</p>
  
  <blockquote>
    <p>TypeError: Error #2004: One of the parameters is invalid.
        at flash.net::NetStream/appendBytes()
        at ...</p>
  </blockquote>