Here’s a routine that creates the effect of text being typed into a TextField…
ActionScript Code:
[LEFT]
var textString:[COLOR=#0000ff]String[/COLOR] = [COLOR=#808080]/ a block of text of any length /[/COLOR]
[COLOR=#808080]// tField is a dynamic text field already on the stage[/COLOR]
var count:uint = [COLOR=#000080]0[/COLOR];
addEventListener[COLOR=#000000]([/COLOR]Event.[COLOR=#000080]ENTER_FRAME[/COLOR], typeout[COLOR=#000000])[/COLOR];
function typeoutCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]
tField.[COLOR=#0000ff]text[/COLOR] = textString.[COLOR=#0000ff]substr[/COLOR][COLOR=#000000]([/COLOR]-textString.[COLOR=#0000ff]length[/COLOR], count[COLOR=#000000]);[/COLOR]
[COLOR=#0000ff] if[/COLOR][COLOR=#000000]([/COLOR]count < textString.[COLOR=#0000ff]length[/COLOR][COLOR=#000000])[/COLOR] count ++;</p>
[COLOR=#0000ff] if[/COLOR][COLOR=#000000]([/COLOR]count == textString.[COLOR=#0000ff]length[/COLOR][COLOR=#000000])[/COLOR] removeEventListener[COLOR=#000000]([/COLOR]Event.[COLOR=#000080]ENTER_FRAME[/COLOR], typeout[COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR][/LEFT]
This does the job it’s supposed to. My question is, if the text is more lines than the allotted lines in the TextField, I’d like the the TextField to automatically scroll down as each new line is added. I’m assuming it has something to do with [COLOR=magenta]bottomScrollV[/COLOR], but I’m stuck on how to implement it. Any suggestions? Many thanks!