# Cant get textfield height from autoSized textfield

**URL:** <https://forum.kirupa.com/t/cant-get-textfield-height-from-autosized-textfield/185696>\
**Category:** flash\
**Created:** [April 15, 2006, 4:03pm UTC](https://forum.kirupa.com/t/cant-get-textfield-height-from-autosized-textfield/185696 "2006-04-15T16:03:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul\_ferrie](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@paul\_ferrie](https://forum.kirupa.com/u/paul_ferrie)\
**Post date:** [April 15, 2006, 4:03pm UTC](https://forum.kirupa.com/t/cant-get-textfield-height-from-autosized-textfield/185696/1 "2006-04-15T16:03:04Z")

</div>

Afternoon guys.  
I am creating a new nwe3s blogger. Instead of relying on a scrollbar to scroll the news story i thought i would use

ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000ff]textField[/COLOR].[COLOR=#0000ff]autosize[/COLOR]=[COLOR=#ff0000]“left”[/COLOR]  
[/LEFT]  
[/FONT]

This works fine…  
At present i am loading x amount of news into flash at any one time. I am placing the news story underneath each other using

ActionScript Code:  
[FONT=Courier New][LEFT]\</p\>  
\<p\>holder.[COLOR=#0000ff]attachMovie[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#ff0000]“newsMc”[/COLOR], [COLOR=#ff0000]“news”[/COLOR] + i, i[COLOR=#000000])[/COLOR];\</p\>  
\<p\>holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i[COLOR=#000000]][/COLOR].[COLOR=#0000ff]\_y[/COLOR] = nextY;\</p\>  
\<p\>nextY += [COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]ceil[/COLOR] [COLOR=#000000]([/COLOR]holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i[COLOR=#000000]][/COLOR].[COLOR=#0000ff]\_height[/COLOR][COLOR=#000000])[/COLOR] + [COLOR=#000080]2[/COLOR];\</p\>  
\<p\>  
[/LEFT]  
[/FONT]

this is fine…  
But when i use

ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000ff]textField[/COLOR].[COLOR=#0000ff]autosize[/COLOR]=[COLOR=#ff0000]“left”[/COLOR]  
[/LEFT]  
[/FONT]

nextY retains it’s orginal height even though some of the news stories have made for higher textfields.  
I thought i could pull the height from the previuosly created news holder

ActionScript Code:  
[FONT=Courier New][LEFT]\</p\>  
\<p\>if [COLOR=#000000]([/COLOR]i \> [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\>j = i - [COLOR=#000080]1[/COLOR];\</p\>  
\<p\>trace [COLOR=#000000]([/COLOR]j + [COLOR=#ff0000]" text height="[/COLOR] + holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + j[COLOR=#000000]][/COLOR].[COLOR=#000080]newsStory[/COLOR].[COLOR=#0000ff]\_height[/COLOR][COLOR=#000000])[/COLOR];\</p\>  
\<p\>if [COLOR=#000000]([/COLOR]holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + j[COLOR=#000000]][/COLOR].[COLOR=#000080]newsStory[/COLOR].[COLOR=#0000ff]\_height[/COLOR] \> [COLOR=#000080]184[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\>nextY += [COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]ceil[/COLOR] [COLOR=#000000]([/COLOR]holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + j[COLOR=#000000]][/COLOR].[COLOR=#0000ff]\_height[/COLOR][COLOR=#000000])[/COLOR] + [COLOR=#000080]2[/COLOR];\</p\>  
\<p\>[COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\>nextY += [COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]ceil[/COLOR] [COLOR=#000000]([/COLOR]holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + j[COLOR=#000000]][/COLOR].[COLOR=#0000ff]\_height[/COLOR][COLOR=#000000])[/COLOR] + [COLOR=#000080]2[/COLOR];\</p\>  
\<p\>trace [COLOR=#000000]([/COLOR][COLOR=#ff0000]“nextY=”[/COLOR] + nextY[COLOR=#000000])[/COLOR];\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]\</p\>  
\<p\>  
[/LEFT]  
[/FONT]

But this still returns the intial height  
Here is the complete code

ActionScript Code:  
[FONT=Courier New][LEFT]\</p\>  
\<p\>for [COLOR=#000000]([/COLOR]i = [COLOR=#000080]0[/COLOR]; i \< [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]newsCount[/COLOR]; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> holder.[COLOR=#0000ff]attachMovie[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#ff0000]“newsMc”[/COLOR], [COLOR=#ff0000]“news”[/COLOR] + i, i[COLOR=#000000])[/COLOR];\</p\>  
\<p\> holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i[COLOR=#000000]][/COLOR].[COLOR=#0000ff]\_y[/COLOR] = nextY;\</p\>  
\<p\> holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i[COLOR=#000000]][/COLOR].[COLOR=#000080]newsTitle[/COLOR].[COLOR=#0000ff]text[/COLOR] = [COLOR=#0000ff]this[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i + [COLOR=#ff0000]‘newsTitle’[/COLOR][COLOR=#000000]][/COLOR];\</p\>  
\<p\> holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i[COLOR=#000000]][/COLOR].[COLOR=#000080]newsDate[/COLOR].[COLOR=#0000ff]text[/COLOR] = [COLOR=#ff0000]“Submitted: “[/COLOR] + [COLOR=#0000ff]this[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i + [COLOR=#ff0000]‘newsDate’[/COLOR][COLOR=#000000]][/COLOR];\</p\>  
\<p\> holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i[COLOR=#000000]][/COLOR].[COLOR=#000080]newsStory[/COLOR].[COLOR=#0000ff]htmlText[/COLOR] = [COLOR=#0000ff]this[/COLOR][COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i + [COLOR=#ff0000]‘newsStory’[/COLOR][COLOR=#000000]][/COLOR];\</p\>  
\<p\> nextY += [COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]ceil[/COLOR] [COLOR=#000000]([/COLOR]holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + i[COLOR=#000000]][/COLOR].[COLOR=#0000ff]\_height[/COLOR][COLOR=#000000])[/COLOR] + [COLOR=#000080]2[/COLOR];\</p\>  
\<p\> [COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]i \> [COLOR=#000080]0[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> j = i - [COLOR=#000080]1[/COLOR];\</p\>  
\<p\> [COLOR=#0000ff]trace[/COLOR] [COLOR=#000000]([/COLOR]j + [COLOR=#ff0000]” text height=”[/COLOR] + holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + j[COLOR=#000000]][/COLOR].[COLOR=#000080]newsStory[/COLOR].[COLOR=#0000ff]\_height[/COLOR][COLOR=#000000])[/COLOR];\</p\>  
\<p\> [COLOR=#0000ff]if[/COLOR] [COLOR=#000000]([/COLOR]holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + j[COLOR=#000000]][/COLOR].[COLOR=#000080]newsStory[/COLOR].[COLOR=#0000ff]\_height[/COLOR] \> [COLOR=#000080]184[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> nextY += [COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]ceil[/COLOR] [COLOR=#000000]([/COLOR]holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + j[COLOR=#000000]][/COLOR].[COLOR=#0000ff]\_height[/COLOR][COLOR=#000000])[/COLOR] + [COLOR=#000080]2[/COLOR];\</p\>  
\<p\> [COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]\</p\>  
\<p\> nextY += [COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]ceil[/COLOR] [COLOR=#000000]([/COLOR]holder[COLOR=#000000][[/COLOR][COLOR=#ff0000]‘news’[/COLOR] + j[COLOR=#000000]][/COLOR].[COLOR=#0000ff]\_height[/COLOR][COLOR=#000000])[/COLOR] + [COLOR=#000080]2[/COLOR];\</p\>  
\<p\> [COLOR=#0000ff]trace[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#ff0000]“nextY=”[/COLOR] + nextY[COLOR=#000000])[/COLOR];\</p\>  
\<p\> [COLOR=#000000]}[/COLOR]\</p\>  
\<p\> [COLOR=#000000]}[/COLOR]\</p\>  
\<p\> [COLOR=#0000ff]unloadMovie[/COLOR] COLOR=#000000[/COLOR];\</p\>  
\<p\> viser.[COLOR=#0000ff]\_visible[/COLOR] = [COLOR=#000080]0[/COLOR];\</p\>  
\<p\>[COLOR=#000000]}[/COLOR]\</p\>  
\<p\>  
[/LEFT]  
[/FONT]
