             this.dispatchEvent(new Event(Event.OPEN));
         }
 
-        private function onOpen(event : Event) : void { _connected = true; }
+        private function onopen(e : Event) : void { _connected = true; }
+
+        private function onerror(e : ErrorEvent) : void {
+            _delete();
+            if (!_events.error)
+                return;
+            _trigger('onRequestEvent', {req_id: _req_id, event: 'error',
+                error: e.text, text: e.toString()});
+        }
+
+        private function onprogress(e : ProgressEvent) : void {
+            _size = e.bytesTotal;
+            if (!_events.progress)
+                return;
+            _trigger('onRequestEvent', {req_id: _req_id, event: 'progress',
+                loaded: e.bytesLoaded, total: e.bytesTotal,
+                text: e.toString()});
+        }
+
+        private function onstatus(e : HTTPStatusEvent) : void {
+            if (!_events.status)
+                return;
+            // XXX bahaa: get redirected/responseURL/responseHeaders
+            _trigger('onRequestEvent', {req_id: _req_id, event: 'status',
+                status: e.status, text: e.toString()});
+        }
+
+        private function oncomplete(e : Event) : void {
+            _delete();
+            if (!_events.complete)
+                return;
+            _trigger('onRequestEvent', {req_id: _req_id, event: 'complete',
+                size: _size, text: e.toString()});
+        }
 
         private function decode(str : String) : void {
             if (!str)

        private var _curr_data : Object;
        private var _hola_managed : Boolean = false;
        private var _req_id : String;

        public function JSURLStream(){
            _hola_managed = HSettings.enabled && ExternalInterface.available;
            addEventListener(Event.OPEN, onOpen);
            super();
            if (!_hola_managed || js_api_inited)
                return;

            }
        }

        private function _delete() : void {
            delete reqs[_req_id];
        }

        protected function resourceLoadingError() : void {
            _delete();
            dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR));
        }

        protected function resourceLoadingSuccess() : void {
            _delete();
            dispatchEvent(new Event(Event.COMPLETE));
        }
    }
