If you have to deal with the issue at the Event dispatch in Flex.




This is not a problem occurring in the dispatch occurs in the event handler.




When A event raises and  a B event handler to handle the case.


Example.


// Normal  case, Use right


main.addEventListener (CustomEventA.DataSend, csEventHandler, false, 0, true);


// Abnormal case, Use wrong


main.addEventListener (CustomEventB.DataSend, csEventHandler, false, 0, true);




private function csEventHandler (e: CustomEventA): void


{


// handle events


}




When the CustomEventA raises to normal operation.


If CustomEventB is the same as a event handler, errors occurs. It is difficult to find this error because error message show at the dispatch event CustomEvent B


"TypeError: Error # 1034: Type Coercion failed: can not convert CustomEventB @ 64e6ca1 to CustomEventB will aereo is to be opened in this way.


If you make a new event handler for CustomEvent B, it can be solved


(Korean)

by 무위자연 2015. 1. 22. 08:48