Moving TextField stuttering

Subscribe to Moving TextField stuttering 6 posts

avatar for Oracions Oracions 2 posts
Flag Post

I have a large multi-line wall of text that I want to scroll from the bottom to the top of the screen slowly.

Currently, I use a TextField with textField.y -= 0.3 in the onEnterFrame event but that looks awful. The movement isn’t smooth and jitters.

Is there something I can do about it, besides increasing scrolling speed?

 
avatar for starfiregold starfiregold 364 posts
Flag Post

Try adding textField to a Sprite, and then move the Sprite instead of textField.

 
avatar for alecz127 alecz127 817 posts
Flag Post

Look up a few different tutorials on what your trying to do, read the code carefully and take your time.
There will be plenty of examples to choose from and apply your new knowledge to make the ends meet.

But I think what star recommended sounds good.
some… masking, allowing dragging on the x axis…

good luck.

 
avatar for Madgvox Madgvox 13 posts
Flag Post

Flash doesn’t like moving text, especially in fractions, because the text is still rendered to the pixel, even when the coordinates aren’t whole numbers. This causes rounding errors when rendering the text.

First, try moving the text by whole numbers, second, if you can get away with it, static text does not have this issue, iirc.

 
avatar for JWBSoftware JWBSoftware 106 posts
Flag Post

Render it to a BitmapData and scroll that. It’s worth doing for performance reasons anyway, assuming the text doesn’t change every frame (and what text does? – players need more than 1/30 second to read it). You can also use all the functions of the BitmapData API to make your text far more interesting than what’s possible with the TextField class.

 
avatar for Madgvox Madgvox 13 posts
Flag Post
Originally posted by JWBSoftware:

Render it to a BitmapData and scroll that. It’s worth doing for performance reasons anyway, assuming the text doesn’t change every frame (and what text does? – players need more than 1/30 second to read it). You can also use all the functions of the BitmapData API to make your text far more interesting than what’s possible with the TextField class.

Ooh, good idea. I hadn’t even thought of that.