Found out problem was that valid is already used by HBox. Changing to another event name and using a custom event allowed me to do what I wanted. However, is there a way to override the use of valid in an HBox, so I can use it my own way?
John --- In [email protected], "j_lentzz" <[EMAIL PROTECTED]> wrote: > > 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 >

