I guess the only way to do it reliable is to ask for the type.
You can use if(  X instanceof Y)  for example

Cheers,
Ralf.

On 2/6/07, gotgoose09 <[EMAIL PROTECTED]> wrote:

  No one has done type checking like this before? If not, oh well. :)

--- In [email protected] <flexcoders%40yahoogroups.com>,
"gotgoose09" <[EMAIL PROTECTED]> wrote:
>
> My current code now loops through the children of a container and adds
> an event handler to each one to listen for a "change" event.
>
> However, I want to only add event handlers to UIComponents that have
> some sort of value that the user can change.
>
> Some examples of these components are: TextInput, ComboBox,
> RadioButton, CheckBox, ColorPicker, List, RichTextEditor, etc.
>
> My current code is something like this: (simplified)
>
> var component:UIComponent = container.getChildAt(i);
> if (component is Container)
> {
> // add event handlers to the container's children
> }
> else if (component is UIComponent && "enabled" in component)
> {
> // add an event handler to component
> }
>
> Unfortunately, this doesn't work for all the various input controls.
> e.g. The RichTextEditor is a Container, so the code tries adding event
> handlers to it's children (I want an event handler on the actual
> RichTextEditor).
>
> Is there a reliable way of detecting a user editable control?
>
> Thanks in advance!
>




--
Ralf Bokelberg <[EMAIL PROTECTED]>
Flex & Flash Consultant based in Cologne/Germany
Phone +49 (0) 221 530 15 35

Reply via email to