Adding a new line or line break in dynamic text box

  • CStrauss
  • Graduate
  • Graduate
  • User avatar
  • Posts: 122
  • Loc: St. Louis MO. USA

Post 3+ Months Ago

I now this is a very simple and silly thing to ask but for the life of me I can not find in documentation or anywhere on the net when you have text in a dynamic text box or any text box for that matter how do you have it add a new line to split up text into multiple lines? I know there is a key word for it but i just can not find it.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

The text field needs to be multiline, so either you set it from designer, or in actionscript:
myText.multiline = true; (where myText is the instance name of your text).
Also you must specify a height for it, usually set a bigger height, but if you want to make it exact height, use textHeight. (first set the text that you want: myText.text = "some text \n a new line \n etc.."; then, myText.height = myText.textHeight)

And finaly, to add a new line ..
if you work in AS3, use myText.appendText("\n"+ newText);
in AS2: myText.text += "\n" + newText;
(\n = new line ).

Anyway, next time you're facing these kind of problems, you can check the online help from adobe for the specific class, in your case TextField class. They have plenty of examples there plus you get to know all methods / properties / events for a class.
  • CStrauss
  • Graduate
  • Graduate
  • User avatar
  • Posts: 122
  • Loc: St. Louis MO. USA

Post 3+ Months Ago

thanks it worked... I did check the online help its just hard to find stuff in there sometimes. Thanks again

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.