Add Process Listener to URLStream : URLStream : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » URLStream »

 

Add Process Listener to URLStream


 
package
{
    import flash.net.URLStream;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.events.ProgressEvent;
    public class Main
    {
        private var streamer:URLStream= new URLStream(new URLRequest("http://example.com/binary_data.bin"));

        public function Main()
        {
            streamer.addEventListener(ProgressEvent.PROGRESS, progressListener);
        }

        private function progressListener(event:Event):void
        {
            if(streamer.bytesAvailable != 0)
            {
                trace(streamer.readByte());
            }
        }
    }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Network
» URLStream