A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Leading (line spacing) different at runtime than authortime?

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    133

    Question Leading (line spacing) different at runtime than authortime?

    Has anyone run into an issue where the line spacing/leading for a Multiline Dynamic Text Field appears to place lines differently when you dynamically populate the text field at runtime than when you type the same text into the Text Field at authortime?

    Put two dynamic Multiline Text Fields on stage aligned horizontally with each other and each has a 9pt line spacing.
    In one Text Field type "Hello Cruel World", putting each word on a separate line.
    Leave the other Text Field blank and name it my_txt.
    Now when I try to populate the empty text field at runtime with:
    PHP Code:
    my_txt.text "Hello\nCruel\nWorld\n"
    The words in the dynamically populated field don't line up with the words in the authortime populated field, even though my_txt.getTextFormat().leading returns as 9!

    1) Anyone have a solution to this?
    I would like a dynamically populated Text Field to appear like it would at authortime, so I can align other graphical elements to it on the stage at authortime, and then the alignment won't change as I update the Text Field's contents at runtime.

    2) Also, on another note, I can't seem to change the Text Field's format via my_text.setTextFormat(newFormat), is this because I placed my_txt at authortime?
    In order to change a text field's format, do you need to add the text field at runtime, for example: var my_txt:TextField = new TextField();?

  2. #2
    Junior Member
    Join Date
    Jan 2010
    Posts
    2
    Yeah, I'm running into this problem too, using dynamic text fields created when authored instead of at runtime and populated using the Strings palette.

    Have you found a solution?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center