Skip to main content
Known Participant
May 19, 2009
Answered

F8as2-displaying leading zeros in a dynamic text field

  • May 19, 2009
  • 1 reply
  • 971 views

F8as2-

Background:

Currently I have to use two different text fields to display 10000 due to the different font sizes.

The 10 is a larger font and the 000 is a smaller font.  When I assign '0 'to the dynamic text fields of the smaller font I get just that a '0' not a '000' which is what I want.

Question:

Is there an easy way to display leading zeros in a dynamic text field?  Or can a dynamic text field have different character positions displayed in different font sizes?  or both?

Thanks for the help.

This topic has been closed for replies.
Correct answer kglad

the only way you can display "number" the way you want and not the way flash wants, is to use strings.

textformatting was an answer to another question you had about displaying different font sizes in one textfield.

1 reply

kglad
Community Expert
Community Expert
May 19, 2009

one textfield can display a variety of fonts/font sizes and other textformat characteristics using either style sheets or the setTextFormat() method of textfields.

to assign leading zeros, use a string:

yourTF.text = "000";

logeyeAuthor
Known Participant
May 19, 2009

F8as2-

Thanks for the reply kglad.

Are for saying the best way to display numerically calculated numbers that need leading zeros and or different font sizes is to convert them to a string for display purposes with textFormatting??

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 19, 2009

the only way you can display "number" the way you want and not the way flash wants, is to use strings.

textformatting was an answer to another question you had about displaying different font sizes in one textfield.