Set your dynamic textbox to "Multiline" and give it a variable name. Then set the scroll property of the variable to move the text.
If your textbox variable was named "scrollBox" and you wanted to scroll it using an up and a down button you'd just need to do the following.
How about using getTimer() to delay incrementing the scroll amount?
This sets up a loop which gets the current time as the movieclip loads then increments the scroll property after a second or so until the whole textbox has scrolled - set the variable maxlines to the amount of lines of text you want to scroll and substitute your dynamic text variable for textBox (hey, it's late here - can't come up with imaginative variable names ;-) )...
onClipEvent (load) {
for (i=1; i<maxLines; i++) {
startTime = getTimer();
do {
elapsedTime = getTimer();
} while (elapsedTime-startTime<1000);
textBox.scroll += 1;
}
}
The only problem with doing things this way is that everything else comes to a standstill while the script runs.
unless you plan on updating the text file through the server the only way around that problem would be to fix the text in a scrolling tween inside a movie clip.. maybe?..wangbars explanation is great but if what he says is true about the script stoping the rest of the movie while it runs would probably not be a good thing..
this is just what I did, but the text ends up being very "jerky" very hard to read.
and yes the paln was to bring the text into the text feild from the server so any writer could update it easily.
what do you guys think about a movieclip that tweens the text under a mask, there would be no way to know how long the text was so you could make it stop at a defined point but ti might scroll smoothly.
Smoothing the motion of the text out might be as simple as adding...
updateAfterEvent();
to your clipEvent, this instantly refreshes the screen and definitely makes a big difference when you're moving graphics around, should do the same for the text.
If not there's no reason you couldn't move the whole textbox around under a mask but if you're tweening you'll have to embed the fonts in order for them to display. It's probably easier to use a piece of script to move the box pixel at a time rather than tween in this case.
I believe updateAfterEvent() doesn't take enterFrame as an argument (although if it doesn't throw an error, what the heck...;-) ). So it might be that in some of your script it only works when the clip loads i.e. once only. To really see the benefits of the action it has to be used in an enterFrame or mouseMove situation.
I don't know if you just cut and pasted this from your movie but if you did then you have "enterframe" in brackets rather than "enterFrame" which will make a difference in it is allowed as an argument. Whenever I've used it in the past I just add it to the clipEvent with no arguments in the brackets and it works great.
When I get a moment I'll run your script and see if I can help out.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.