Accessing Data Being Downloaded : URLStream : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » URLStream »

 

Accessing Data Being Downloaded


 
package {
  import flash.display.*;
  import flash.events.*
  import flash.net.*;
  
  public class Main extends Sprite {
  
    public function Main(  ) {
      var streamer:URLStream = new URLStream(  );
      
      streamer.addEventListenerProgressEvent.PROGRESS, handleProgress );
                       
      streamer.loadnew URLRequest"example.txt" ) );
    }
    
    private function handleProgressevent:ProgressEvent ):void {
      var streamer:URLStream = URLStreamevent.target );
      
      while streamer.bytesAvailable > ) {
        trace"Read byte: " + streamer.readByte(  ) );    
      }
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Network
» URLStream