This content has been marked as final. Show 2 replies
Check out the TextFormat class and its getTextExtent method. It calculates the size of a textfield for a given string and a given textfield width. With that, it's easy to resize or create a textbox with the right size.
Okay found this:
[Dynamic Text Box Name].autoSize = "center";
[Dynamic Text Box Name].wordWrap = true;
however, the height really doesn't adjust when the copy does. If I start
off with the dynamic text box at 50 pixels high, it remains that way
when calculated in ActionScript using the [MovieClip]._height even
though it is much taller than 50 pixels with the copy in there.
So I'm back to the drawing board. I want to have an XML file with
Headline, BodyCopy, and disclaimer copy. I want to call the nodes into
Flash and stylize them.
I DO NOT want to use CSS since I am using funky fonts that will not be
available on all machines. Want those fonts embedded in Flash so it
shows the same on any computer.
W. Kirk Lutz wrote:
> I am brand new to XML and pulling in text to Flash from it. So far so
> good. The text shows. The only thing I'm having trouble with is the
> height of the text box the imported text sits in. I want it to
> dynamically expand if the text is long.
> How can I go about importing text into a text Dynamic text box and have
> the box expand if the text is too long for the manual setting?