A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: checking # of lines in a text field

  1. #1
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Hi...

    I'm building a Flash interface, in which there is a text field large enough to display about 8 lines of text...This field is populated by reading in an external text file...The text files vary greatly in length, from a single word to several paragraphs...

    So, I'm wondering if there's a way to check the properties of the text field to find out if the text is longer than the visible area...based on the results of this, I would then set the visibility of a scrollbar movieclip on or off depending whether they were necessary...

    Any help appreciated...

    K.

  2. #2
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    if (textfieldname.maxscroll > 8) {
    scrollbar._visible=true;
    }

  3. #3
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    Actually, that's wrong, sorry. Maxscroll is the number of lines which do not fit on the page. I don't know if it = 0 when everything fits on the page, but something more like this would work...

    if (textfieldname.maxscroll > 0) {
    scrollbar._visible=true;
    }

    Or maybe > 1...

  4. #4
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    Thanks!

    Figured it was probably about that easy, just wasn't sure how to go about it...

    Cheers,

    K.

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