Hi,
I have a custom component based on an HBox. Internally it has 2 radio
buttons in a group. I want the component to contain a validator, so I
can use the valid and invalid props on it. For example:
<comp:TwoButtonGrp id='test' valid='validHandler()'
invalid='invalidHandler()'/>
Inside the component, I have Event tags like:
[Event(name="valid", type="mx.events.ValidationResultEvent")]
[Event(name="invalid", type="mx.events.ValidationResultEvent")]
so the mxml component can have the valid and invalid tags - like a
validator has.
The problem is that in side the component I have handlers that get the
valid and invalid results from the internal validator - however,
whenever I try to dispatch them using dispatchEvent(event), I get an
error about Type Coercion failed: cannot convert
mx.events::ValidationResultEvent to mx.event.FlexEvent
Here is the routine:
private function validHandler(event:ValidationResultEvent):void {
trace('internal valid handler');
dispatchEvent(event);
}
I don't understand the error, since the parameter for dispatchEvent is
Event type and ValidationResultEvent is extended from that class.
Any help would be greatly appreciated.
John