Skip navigation
Currently Being Moderated

Text Display Problem...

Aug 7, 2012 5:01 AM

I want to place 3 or 4 text fields in a line. Each text field having some text. And I Changed the font size of text in textfields dynamically.

I assign x value for each textfield as follows:

 

let us consider txt0,txt1,txt2 and tx3 fields are there...

 

txt0.x = 0;

txt1.x = txt0.x + txt0.textWidth + 5;

txt2.x = txt1.x + txt1.textWidth + 5;

..... like that

 

I placed these textfields in a moveiclip in one line.

But the problem is, When I change the font size,If any textfield having two words, it display first word completely but second word is displayed as half.

 

Suppose if "Soup song..." is a text in txt0. It is displayed as "Soup so"

 

Please help me if anyone know. And I think this is width of textfield problem. If it is please mention, how to solve it?

 
Replies
  • Currently Being Moderated
    Aug 7, 2012 5:12 AM   in reply to bhargavi reddy

    Research the TextField class autoSize property.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2012 9:00 AM   in reply to bhargavi reddy

    You're welcome.  Since you are basing the spacing on the textWidth, you can probably just maximize the textfield widths to start with if that's the approach you want to run with. 

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 8, 2012 4:43 AM   in reply to bhargavi reddy

    You should only need to center the moviewclip that the textfields are in.  If the movieclip has its registration mark in the upper left corner, then you just need to nase its position on half the stage size minus half the movieclip size.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points