[flexcoders] Flex 1.5 TextArea height
Hello FlexCoders, I have TextArea on the stage, it has some size. After app initialized I'm populating TextArea with new data, scrollbar appears and it works good. But I need next functionality,I need TextAreaexpand it's height, so all text is visible without vertical scrollbar. It looks like an easy task, we just should extend TextArea and at some moment set height of TextArea to new value, But here I have questions: 1. At what moment I should change height? What event I should listen? 2. What value I should set to height? Best regards Stanislav __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: [flexcoders] Flex 1.5 TextArea height
Hello Stanislav, This question was asked at Flexcoders not only once. Basically, the correct question is: How to determine the content length in mx:Text? mx:TextArea component does not measure itself when the text content is changed dynamically. Manish had suggested to override measure method of mx:TextArea http://www.mail-archive.com/flexcoders@yahoogroups.com/msg13269.html When I look inside implementation of measure method inside mx:Text, it is much more advanced then his mx:TextArea counterpart. Can you post the code when mx:Text component does not work for you? -- Best regards, Andriymailto:[EMAIL PROTECTED] Yahoo! Groups Sponsor ~-- Protect your PC from spy ware with award winning anti spy technology. It's free. http://us.click.yahoo.com/97bhrC/LGxNAA/yQLSAA/nhFolB/TM ~- -- 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/ * 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/
Re[2]: [flexcoders] Flex 1.5 TextArea height
Hello Stanislav, One more idea found by me at history of the Flexcoders mailing list is to use TextFormat.getTextExtent() function to calculate the size of the text: http://livedocs.macromedia.com/flash/mx2004/main_7_2/1840.html#40 Example: -- var txtFmt:TextFormat=new TextFormat(); txtFmt.font=this.getStyle(fontFamily); var labelMetrics:Object=txtFmt.getTextExtent(code); var initObj:Object=new Object(); initObj.x=Math.floor(this.width/2)-Math.floor(labelMetrics.textFieldWidth/2); initObj.y=this.height-(this.getStyle(fontSize)+margin); initObj.text=code; this.createChild(mx.controls.Label,,initObj); -- -- Best regards, Andriymailto:[EMAIL PROTECTED] Yahoo! Groups Sponsor ~-- Home is just a click away. Make Yahoo! your home page now. http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/nhFolB/TM ~- -- 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/ * 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/
Re: Re[2]: [flexcoders] Flex 1.5 TextArea height
ConcerningManish example, what is the magic numbers there? _measuredPreferredHeight = label.textHeight + 4; And it doesn't work! I will try getTextExtent workaround. Best regards Stanislav On 6/14/06, Andriy Panas [EMAIL PROTECTED] wrote: Hello Stanislav,One more idea found by me at history of the Flexcoders mailing listis to use TextFormat.getTextExtent () function to calculate the size of the text:http://livedocs.macromedia.com/flash/mx2004/main_7_2/1840.html#40Example: --var txtFmt:TextFormat=new TextFormat();txtFmt.font=this.getStyle(fontFamily);var labelMetrics:Object=txtFmt.getTextExtent(code);var initObj:Object=new Object(); initObj.x=Math.floor(this.width/2)-Math.floor(labelMetrics.textFieldWidth/2);initObj.y=this.height-(this.getStyle(fontSize)+margin);initObj.text=code;this.createChild(mx.controls.Label,,initObj); Best regards,Andriymailto:[EMAIL PROTECTED] Yahoo! Groups Sponsor ~-- Home is just a click away. Make Yahoo! your home page now.http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/nhFolB/TM~- --Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txtSearch Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links* To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * 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/ __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
Re: Re[2]: [flexcoders] Flex 1.5 TextArea height
Ok, let's forget about getTextExtent.. Because it is has it's own limitations. What Adobe guys cansuggest to me? On 6/14/06, Stanislav Zayarsky [EMAIL PROTECTED] wrote: ConcerningManish example, what is the magic numbers there? _measuredPreferredHeight = label.textHeight + 4; And it doesn't work! I will try getTextExtent workaround. Best regards Stanislav On 6/14/06, Andriy Panas [EMAIL PROTECTED] wrote: Hello Stanislav,One more idea found by me at history of the Flexcoders mailing listis to use TextFormat.getTextExtent () function to calculate the size of the text:http://livedocs.macromedia.com/flash/mx2004/main_7_2/1840.html#40 Example:--var txtFmt:TextFormat=new TextFormat();txtFmt.font=this.getStyle(fontFamily);var labelMetrics:Object=txtFmt.getTextExtent(code); var initObj:Object=new Object(); initObj.x=Math.floor(this.width/2)-Math.floor(labelMetrics.textFieldWidth/2);initObj.y=this.height-(this.getStyle(fontSize)+margin);initObj.text=code;this.createChild (mx.controls.Label,,initObj); Best regards,Andriymailto: [EMAIL PROTECTED] Yahoo! Groups Sponsor ~-- Home is just a click away. Make Yahoo! your home page now. http://us.click.yahoo.com/DHchtC/3FxNAA/yQLSAA/nhFolB/TM~- --Flexcoders Mailing ListFAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txtSearch Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links* To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * 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/ __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___