There is no such interface. You can work around this by "casting away"
the UIComponent type:

 

var textThing:UIComponent;

...

Object(textThing).text = "Hello";

 

If you don't want to defeat type-safety, you'll have to do

 

if (textThing is TextInput)

    TextInput(textThing).text = "Hello";

else if (textThing is TextArea)

    TextArea(textThing).text = "Hello";

 

You could obviously put this in a utility method like setText().

 

Gordon Smith

Adobe Flex SDK Team

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Dale Cook
Sent: Thursday, August 21, 2008 9:38 AM
To: [email protected]
Subject: [flexcoders] TextInput and TextArea ancestory

 

I need to write a class that can contain either a TextArea or
TextInput as one of it's private parameters. Essentially it's a
composite component that can be either a TextInput or TextArea with
some additional properties. My problem arises from the fact that the
common ancestor to both of these controls is UIComponent that does not
have a "text" attribute so I can't cast down to that common ancestor
when setting the text attribute.
Since I don't know that much about Flex I was wondering if there's a
common interface I'm missing or some other way to achieve access to
what I thought would be a common attribute.

Dale 

 

Reply via email to