4 Replies Latest reply on May 2, 2006 11:53 AM by halcyon32

    mc._height based off .maxScroll

    halcyon32
      Hi All,
      I'm having a little problem with maxscroll. I am using the total number of text lines(maxscroll) multiplied by 14 to give me the _height of a movie clip called entryBackMiddle... Seems to work until I look closer... it appears that some of my clips are sized to long and other clips are to short... Originally I was using .textHeight but that keeps giving me undefined so I switch over to maxscroll...

      What I think might be the problem is:
      var maxScrollHeight:Number = this["entry_clip" + h + "" + i].entry_text.maxscroll;

      I have also included a file and the entire code of how I'm looping thought my xml and attaching my clip in case its something else is wrong.

      Any and all help will be greatly appreciated :-)
      Thanks in advance
      Scott
        • 1. Re: mc._height based off .maxScroll
          shyaway Level 1
          not quite sure what to make of your question...

          if you want the textField to resize to fit to the content. use the property to do it,
          my_txt.autoSize = true;
          this will resize your textField automatically to fit it, if it's multiline/word wrap are enabled. the height will get resized. if single line, the width will get resized.
          you can then get your height/width using my_txt._height and my_txt._width.
          • 2. Re: mc._height based off .maxScroll
            halcyon32 Level 1
            Hi shyaway,
            Thanks for the reply.

            I'm using autoSize = true here:
            this["entry_clip" + h + "" + i].entry_text.autoSize = true;

            I then get the number of text lines with maxscroll here:
            var TextHeight:Number = this.timelines_MC["plot"+h+""+i].entry_clip.entry_text.maxscroll;

            what I am tyring to do is size a movie clip behind my text box based off the maxscroll of the same text box. So if I have say, 4 lines of text * 14 that gives me 56 I then go and size my movieclip to 56 pixels. this seems to give me wrong numbers for some of my text boxes...

            when I try to get text._height I get undefined
            var TextHeight:Number = this.timelines_MC["plot"+h+""+i].entry_clip.entry_text._height;

            Or when I try to get entry_text.textHeight I get undefined
            var TextHeight:Number = this.timelines_MC["plot"+h+""+i].entry_clip.entry_text.textHeight;

            The only thing that gives me back a number is maxscroll but its not the right number for every clip...

            could it be something to do with embedded fonts, or dynamic text?


            Any and all help will be greatly appreciated :-)
            Thanks in advance
            Scott
            • 3. mc._height based off .maxScroll
              halcyon32 Level 1
              Is maxscroll deprecated?
              • 4. Re: mc._height based off .maxScroll
                halcyon32 Level 1
                Ok so apperntly flash dosn't like deprecated code
                here is my fix..

                [CODE]//-------------Text Size------------//
                this.timelines_MC["plot"+h+""+i].entry_clip.my_entry_text.autoSize = true;
                this["plot" + h + "" + i].entry_clip.my_entry_text.wordWrap = true;
                this.timelines_MC["plot"+h+""+i].entry_clip.my_entry_text.multiline = true;
                this.timelines_MC["plot"+h+""+i].entry_clip.my_entry_text.htmlText = entry_text;
                //this.timelines_MC["plot"+h+""+i].entry_clip.my_entry_text.setTextFormat(this.myformat);
                //

                var TextHeight:Number = this.timelines_MC["plot"+h+""+i].entry_clip.my_entry_text.textHeight;

                var maxTextHeight:Number = Math.ceil(TextHeight);
                trace("TextHeight-------"+TextHeight);
                trace("maxTextHeight-------"+maxTextHeight);
                //

                //
                this.timelines_MC["plot"+h+""+i].entry_clip.textBoxBack.entryBackFull._height = maxTextHeight + 35;
                this.timelines_MC["plot"+h+""+i].entry_clip.textBoxBack.gradient._height = maxTextHeight + 35;
                this.timelines_MC["plot"+h+""+i].entry_clip.textBoxshadow._height = maxTextHeight + 35;
                //-------------Text Size------------//[/CODE]

                Thanks
                Scott