gabriel / as3httpclient

HTTP Client for AS3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't re-dispatch events

mattupstate opened this issue · comments

Currently its impossible to re-dispatch events. For example...

private function statusHandler( event:HttpStatusEvent ):void
{
    dispatchEvent( event );
}

It will throw this error:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@16be0a1 to org.httpclient.events.HttpStatusEvent.

To fix, override the clone() method in your event classes. For example:

override public function clone():Event 
{
    return new HttpStatusEvent( response, type, bubbles, cancelable );
}