-
Resize text box dynamically?
Hi all,
I need to create a single-line text box that loads from an external text file. I have no problem with this, except that I need the box to "expand" to the right to the size of the imported text, and I can't figure out how to do that!
I'm making a kind of horizontal "subtitle scroller" that's controlled by a slider, so basically I need to have one long text box that stretches off to the right far enough to display all the text that's loaded into it.
Any ideas?
-
I guess I could just put a large amount of placeholder text in the fla, that's bigger than anything I'd want to load dynamically; just thought there might be a more elegant way to do it...
-
textBoxInstance._width = textBoxInstance.textWidth;
the same can be done for the height:
textBoxInstance._height = textBoxInstance.textHeight;
works great, but I've noticed with some fonts you have to add an additional 5-10 pixels
My flash never has bugs, it just develops random features.
-
TextField.autoSize In the AS dictionary.
-
Thanks guys, those both look like good options!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|