3 Replies Latest reply on May 2, 2008 3:51 PM by Nlammertyn

    Modifying a movieclip to match textfield

    Nlammertyn
      Hi, I've searched everywhere and can't seem to find a good answer. The situation is:
      I have an mc wich is in a scrolling-script and the script needs the height of the mc to scroll. In the mc I have a textfield wich loads external html. This has autoSize and it does work, but the mc doesn't match his size automatically. Resulting in my scrolling going bad (Or I can't see all the text or there's white space after it).
      Any idea how I could achieve that the mc would resize himself to match the textfield?

      Thanks in advance
        • 1. Re: Modifying a movieclip to match textfield
          noba
          Somewhere in the code, probably see a hard-coded number that was the previous height of your MC, and that number will be put into variable to tell your script the height of your MC. Find that part of your script, and set that variable to the new height of your MC. To get the height, click on the MC (not on the text box within the MC) and look at your Info panel to see the height. That's the number you will need to put in your script.

          The other option is put movieClipNameGoesHere._height into that variable so that you don't have to set it each time, but hard-coding actually lets you fine tune it a little better.

          Hope this helps :)
          • 2. Re: Modifying a movieclip to match textfield
            Rothrock Level 5
            Not sure what a "good answer" is. There is only an/the answer and it is neither good or bad! :)

            Anyways, my guess is that the scroller is getting the height before the external text has loaded. You don't say how you are doing that but depending on how there might be a onLoad event which you can use to then set the size for scrolling.
            • 3. Re: Modifying a movieclip to match textfield
              Nlammertyn Level 1
              Yep, thx, noba made me thinking about what you said rothrock, so I had already figured it out before I saw your post, but you were spot on. I delayed the scrolling function for 0.1 sec. and now it works like a charm.

              Thanks a million