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.as or 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 http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to