1 Reply Latest reply on Jun 3, 2006 5:01 AM by blemmo

    Dynamic text field issue:  Handling overflowing text?

    Level 7
      When putting large amounts of text into dynamic text box the usual case is
      to Mask it and then add a Scrollbar.

      However I wish to paginate the text so that a user can click onto the next
      page if there is more text.. (no scrolling)

      My problem is how do I detect this Over-Flowing text in Flash?


        • 1. Re: Dynamic text field issue:  Handling overflowing text?
          blemmo Level 1
          For Flash >= 7 you can use the getTextExtent method to get the textfield size necessary to show a given string. Assuming the textfield is called 'textfield' (how creative... ) and the string displayed is called 'tftext':

          var tf = textfield.getTextFormat(); // gets font information
          var tx = tf.getTextExtent(tftext,textfield._width); // tx contains size of textfield for given width and string
          if (tx.textFieldHeight > textfield._height){
          // text is more than 1 page