A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: [RESOLVED] Truncate Text in Dynamic Text Field?

Hybrid View

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    133
    To clarify further... I would want the text box to look like this:

    Code:
    +-------------------------+
    | The Assasination of     |
    | Jesse James by the ...  |
    +-------------------------+
                                        <--- NO BELOW THE FOLD TEXT
    Although, I suppose if I absolutely couldn't get the above, this would be acceptable as well, although, I fail to see how this would be possible and the above wouldn't:

    Code:
    +-------------------------+
    | The Assasination of     |
    | Jesse James by the ...  |
    +-------------------------+
     Coward Robert Ford        <--- below the fold text

  2. #2
    Senior Member
    Join Date
    Jan 2006
    Posts
    133
    I swear to all that was mighty, that this wasn't working when I posted... now it is!

    Ok, anyway, if this is the text box:

    Code:
    +-------------------------+
    | The Assasination of     |
    | Jesse James by the      |
    +-------------------------+
    Coward Robert Ford          <--- below the fold text
    First I get the text from the last line, using bottomScrollV, and if then I can replace the last word/whitespace character with "..." and then append that to the end of the first line

    In short:

    PHP Code:
    var LastLineText_str:String myTextField.getLineText(myTextField.bottomScrollV 1);

    // this gets me "Jesse James by the " in a string
    // Then just run an operation to replace "the" or the " " character with an ellipse 

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