jiangtiandao / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

WIndowShadeEvent does not override clone() #263

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to redispatch a WindowShadeEvent object
2. get cryptic type coercion failed exception

What is the expected output? What do you see instead?

Expect events to get redispatched cleanly when doing the following:

protected function openHandler(e:WindowShadeEvent):void {
  dispatchEvent(e);
}

but instead see

[Fault] exception, information=TypeError: Error #1034: Type Coercion
failed: cannot convert flash.events::Event@21553461 to
flexlib.events.WindowShadeEvent.

Please provide any additional information below.

from
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/Event.htm
l#clone%28%29
:

When creating your own custom Event class, you must override the inherited
Event.clone() method in order for it to duplicate the properties of your
custom class. If you do not set all the properties that you add in your
event subclass, those properties will not have the correct values when
listeners handle the redispatched event.

Original issue reported on code.google.com by ken.rai...@gmail.com on 25 Nov 2009 at 6:48