6 Replies Latest reply on Aug 2, 2006 8:18 AM by kglad

    Dynamic popup text box...

    DIY_Lobotomy
      I have a text box with a ton of text in it (multiple paragraphs). Functionally, what I'd like to do is have it so that I can have people click on (or roll over) certain words, and then a definition pops up in a blue box (kinda like a tooltip)...

      I could make one "box" movieclip with a dynamic text field in it, and then just use it as a transparent button over each word that needs to be defined within the paragraph (loading the definition text inside the "box" dynamically), but I wouldn't know how to adjust the size of the box so that it fits each definition's text. (like, some definitions may be a couple words, and some may be a sentence or two, so if the box is always just one size, that won't work)...

      That being said, the only thing I can think of is having a separate "box" movieclip (each sized to its separate dimentions) in the library. But with all of those definitions, that will increase the file size huge...

      There's gotta be a simple solution to this that I'm missing - any ideas?! Thanks!...
        • 1. Re: Dynamic popup text box...
          kglad Adobe Community Professional & MVP
          use the asfunction and an html enabled textfield.
          • 2. Re: Dynamic popup text box...
            15266
            I would create the text box movie clip one of two ways. Either design the size of the popup text box to accommodate the biggest block of text you have (so all other will therefore fit into the same space) or alternatively have a textarea component as a text box which has scrollbar functionality.
            • 3. Re: Dynamic popup text box...
              DIY_Lobotomy Level 1
              quote:

              Originally posted by: 15266
              I would create the text box movie clip one of two ways. Either design the size of the popup text box to accommodate the biggest block of text you have (so all other will therefore fit into the same space) or alternatively have a textarea component as a text box which has scrollbar functionality.

              Yeah - I actually thought of both of those options. They'd both certainly work, but they wouldn't produce the "ideal" result that I'm after. Just wondering if there's be a way to get exactly what I needed. Hmmmmm....

              • 4. Re: Dynamic popup text box...
                kglad Adobe Community Professional & MVP
                to size your textfield use the autoSize property of textfields.
                • 5. Re: Dynamic popup text box...
                  DIY_Lobotomy Level 1
                  quote:

                  Originally posted by: kglad
                  to size your textfield use the autoSize property of textfields.

                  I thought of that too. That solves the problem of the text field itself being the correct size, but I then need the box_mc that the text field is IN to be sized correctly....

                  ...the reason I need the text field in a box (as opposed to just stand-alone) is simply for aesthetics. I need a semi-transparent blue background behind the text.

                  Is there a way (maybe) to auto-size the text field, then grab the size that it was autosized to into variables, then apply those variables to size the box_mc??? I'm just grasping at straws here - I don't even know if that's possible...

                  ...if it IS possible, could someone help get me started with a sample code? Thanks!

                  • 6. Re: Dynamic popup text box...
                    kglad Adobe Community Professional & MVP
                    yes, the textfield will autosize to fit your text and you can then use its dimensions to size whatever else you want to size.