3 Replies Latest reply on Feb 2, 2010 2:01 AM by deshggg

    Determine is scrolling is required on dynamic text? (AS2)


      Hey everyone,

      I have a few text based pages on a site i am trying to build which contain dynamic text (contained within a database, which can be changed from elsewhere). These are loaded into a dynamic text box of a fixed size that fits within my page. This all works great. I have created two scroll movieclips (which act as buttons, one for up, one for down) which when clicked cause the textbox to scroll up or down as relevant. These work fine as well.

      The problem i'm having is I only want the scroll buttons to appear if they are required (ie if the text within the text field is larger than its height so you need to scroll to read it all), but i cannot work out how to find the height of the actual content (as opposed to the height of the predefined dynamic text box). I can obviously create the textbox as autosized, then find it's height, then compare it to the desired height and (if it's larger) manually change it's height and display the scroll buttons, however i cannot imagine this is the most effective way to do it at all?

      I'm sure there is a standard, logical way to do this but i cannot seem to find any reference to it online or in the forums, but maybe because i'm searching for the wrong thing?

      Thanks so much for your help in advance everyone, it really is appreciated,