4 Replies Latest reply on Aug 4, 2010 10:49 PM by Vanoppo

    Evenly Spacing Dynamic Text Fields defined by variables.

    Vanoppo

      For starters here is the website im working on: http://nodramastateside.com/Ivans/

       

      What im going to be doing is replacing the bottom info with just a link-strip, unfortunatly I didn't want to have to sift through ten dynamic text fields re-animating every one with tweens to the way I wanted them so I set them all to a parent variable defined as "mt", such variables being as follows:

       

      Home

      Portfolio

      Documentation

      Dev Blog

      Case Studies

      Support Forum

      Staffing

      About Us

      Mixes

      Contact

       

      So what it basically does is makes every "link" self defined in the movie-clip root, and thus different text per link.

      The code looks like this;

       

      onClipEvent(load){this.mt="Home";

      this.mc=mt // used elsewhere for transition effects

      }

      on(rollOver){this.gotoAndPlay(11)}

      on(rollOut){this.gotoAndPlay(1)}

      on(release){

      this.gotoAndPlay(21);

      _root.sectioncontrol.nextsection=mt;}

       

      What I'm trying to figure out, is how to:

       

      a) figure out the width of all text fields based on the varibale, and adjust the dynamic text "hit box" to fit it accordingly

      b) space all ten links evenly on the horizontal plane

       

       

      hope you all may help =]

        • 1. Re: Evenly Spacing Dynamic Text Fields defined by variables.
          kglad Adobe Community Professional & MVP

          you can use the autoSize property (assigned to "left") to size a single line textfield to just fit its text.

          1 person found this helpful
          • 2. Re: Evenly Spacing Dynamic Text Fields defined by variables.
            Vanoppo Level 1

            Ah, totally forgot about that function xD

            Thank you sir! =]

             

            Any idea for the other?

             

            I was thinking maybe grabbing the _x location and adding the width of said object to the next _x location of the following link, with a +20 or so space,

             

             

            Im trying it out with textWidth currently. hope it works

            • 3. Re: Evenly Spacing Dynamic Text Fields defined by variables.
              Vanoppo Level 1

              Alrighty! Got it working =]

               

              onClipEvent(Load){this.mt="Portfolio";

              this.mc=mt // used elsewhere for transition effects

              this.texter.autoSize = "left"

              rt = this.texter.textWidth

              _x=(_root.intro.footer.Home._x)+(_root.intro.footer.Home.rt)+10

              }

              on(rollOver){this.gotoAndPlay(11)}

              on(rollOut){this.gotoAndPlay(1)}

              on(release){

              this.gotoAndPlay(21);

              _root.sectioncontrol.nextsection=mt;}

               

              What id like to know now if possible, is how to refresh the movie clips?

              In the last "link area" of the lower linkbar I have this line of code to determine the correct placement of the first link area upon which all the rest are aligned

               

              widther= (_x+((_root.intro.footer.Home._x)*-1)+rt)

              _root.intro.footer.Home._x=(widther/2)*-1

               

              And that places the "Home" link area in the correct location for what I'm looking for,

               

              since all of the other areas get their x locations on load, and I dont want them sitting there checking the area every frame, I know there is a "refresh" function, I'd just like to know how to apply it (when placing after the "middle location" code for home) to the rest of the clips =]

              • 4. Re: Evenly Spacing Dynamic Text Fields defined by variables.
                Vanoppo Level 1

                Ended up answering my own question in a way, thanks adobe =]