I posted the question on making a Text control do this on the flexcomponets
list.  I got
" Yes, you can override truncateToFit in a subclass of UITextField to make
it work with multiline text. I did it once a while back, and it wasn't very
difficult. If I can find the code, I'll post it on my blog and link to it
here.

Josh Tynjala
www.zeuslabs.us"

as a response, hope he posts something, eh?

on exploring the framework....as nice as those posters are on the wall, so
far my experience has been just delving in and hacking it up, yeehaw!  I use
the docs heavily then open the source to try and see.  At which point I
notice that I'm sapping up the time, a few minutes later have to jump ship
or drop anchor as they say.

Maybe a good topic for upcoming meeting?


DK


On 4/24/07, Clarke Bishop <[EMAIL PROTECTED]> wrote:

 Thanks Doug!

The other part of my question is about exploring the Flex Framework.
What's the best way to get started? Suppose I want to see what's contained
inside the Text Class. I know how to use the docs to see the Text Class
properties, methods, events, etc. But, what about other objects in the
class?

Thanks,

   Clarke

 ------------------------------
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Douglas
Knudsen
*Sent:* Monday, April 23, 2007 8:46 PM
*To:* [email protected]
*Subject:* Re: [AFFUG Discuss] Truncating Text Length

oops, Label.as has a UITextField, my bad.
protected var textField:UITextField;
hey, its protected, so, if I recall my accessors correctly, this means you
can access it in classes that extend Label.

extending UITextField and overriding truncateToFit() might be the way to
go.

Yeah, the API is quite daunting to say the least.  But hey, its smaller
than Java!  ;)

DK

On 4/23/07, Clarke Bishop <[EMAIL PROTECTED]> wrote:
>
>  In Flex 2, if the text is too long for a Label  control, Flex truncates
> the text and adds a "..." to the end. The Text and TextArea controls just
> truncate the text.
>
> I would like to add the Label-style "..." behavior to *multi-line* Text
> and TextArea controls.
>
> I talked to Doug at the last CFLunch, and he said:
>
>  " You over-ride the data setter/getter for custom renderers, not what
> you were trying to do.  Have a look at truncateToFit() inside
> UITextField.as.  You might be able to model your component after Text.asor
> Label.as which extends Label which extends UITextField.  truncateToFit()
> is where the truncation routine is, its public so over-rideable. "
>
> This makes sense and it looks like truncateToFit() may do what I want.
>
> Now, here are my questions:
>
> 1. truncateToFit() is a method of the UITextField object. Now, I know
> that TextArea.as has a UITextField. But, in general, what's the best way
> to see what other objects are inside of a control?
>
> 2. I know it's in there somewhere, but how do I access the UITextField.
> How do I get a handle to the internal object.
>
> 3. Both of the above questions may be the two ways to ask the same
> question -- I'm not sure. The other thing I want to know is what's the best
> practice way to reference an internal, contained object?
>
> 4. From looking at the Text Class, I think one thing Doug said was
> wrong. Text does not extend UITextField, it extends UIComponent. I think
> Text uses composition to "have a" UITextField. This is what I'm trying to
> understand.
>
> I think I have a good understanding of what I'm trying to do. It's just
> that the complexity of Flex can be overwhelming as I try to wade through all
> the ActionScript. I'm looking for ideas on how to best structure my search.
>
> Thanks for any advice!
>
>    Clarke
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------




--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------

-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in
the subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by FusionLink <http://www.fusionlink.com>
-------------------------------------------------------------




--
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?



-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to