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]