Well after I resize the element I was using the measureHeight to get the 
height and pass it to other components.
Could you post an example with the viewMetrics.
Thanks


Alex Harui wrote:
>
> Not sure why you’re not using Text instead of TextArea.
>
> If you don’t copy the sizing algorithm of the TextArea’s internal 
> textfield, then your measurments won’t be correct. I don’t think -10 
> is going to be right and I don’t understand 3.9 either. The code is 
> much simpler than that. It uses viewMetrics.
>
> ------------------------------------------------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] 
> *On Behalf Of *Guillermo Villasana
> *Sent:* Wednesday, September 19, 2007 10:45 AM
> *To:* [email protected]
> *Subject:* [flexcoders] Problem with sizing
>
> Hi everyone, well I am still having problems with resizing a Text Area.
> At the moment I am using this code:
>
> package mylib
> {
> import mx.controls.TextArea;
> import flash.text.TextField;
> import mx.controls.Alert;
> public class AdvancedTextArea extends TextArea
> {
> public function AdvancedTextArea() {
> super();
> this.editable=false;
> this.selectable=false;
> this.verticalScrollPolicy="off";
> this.horizontalScrollPolicy="off";
>
> }
>
> override protected function measure():void
> {
> super.measure();
> var myTF:TextField=new TextField();
> var altoxLineas:Number=new Number();
> myTF.wordWrap=true;
> myTF.text=text;
> myTF.width=explicitWidth-10;
> altoxLineas=myTF.numLines*3.9+altoxLineas/3.9;
> measuredHeight = measuredMinHeight =
> myTF.textHeight + 10;
> if (altoxLineas>myTF.textHeight) measuredHeight
> = measuredMinHeight = altoxLineas + 10;
> }
> }
> }
>
> Although it does grows my Textarea, in some cases it doesn't grow it
> enough... Any pointers would be appreciated.
>
>  



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to