as3httpclient icon indicating copy to clipboard operation
as3httpclient copied to clipboard

Can't re-dispatch events

Open mattupstate opened this issue 15 years ago • 0 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 );
}

mattupstate avatar Jan 20 '10 21:01 mattupstate