5 Replies Latest reply on Sep 30, 2009 2:16 PM by gotoAndExplore

    how do i make a scrolling text box?

    gotoAndExplore Level 1

      hi, i'm looking to make a text box that the user can control the scrolling, i've made it how i want it to look already, but i haven't got a clue where to start as to how to make it actually work.

       

      here's how i've got it set up so far, okay this is gonna take some explaining:

       

      i've got the document made up in AS2, the movieclip known as 'Philosophy_tween' is on the main timeline, and inside that movieclip are two more child movieclips, one for the text and another for the scrollbar.

       

      the text movieclip is set to scroll upwards, behind a masking layer using a motion tween on the parent movieclip, whereas the scrollbar movieclip motion tweens (inside itself) the scroller button. look at the attached image.

       

      both motion tweens have a stop(); script at the beggining.

       

      i don't know what to do after this though, so please help, thanks in advance!

        • 1. Re: how do i make a scrolling text box?
          Ned Murphy Adobe Community Professional & MVP

          If you download the file linked in the initial message of the following posting, you will see a different approach that may be simpler for you to manage.  Just rename the file to have an "fla" extension to open it in Flash.

           

          http://forums.adobe.com/thread/498506?tstart=60

          2 people found this helpful
          • 2. Re: how do i make a scrolling text box?
            gotoAndExplore Level 1

            that way does look alot easier, but it doesn't let me have different text formatting in the text field or use a sliding scroller button, both of which i'm using. is there any way i could adapt this technique to allow for these as well?

            • 3. Re: how do i make a scrolling text box?
              gotoAndExplore Level 1

              just as an experiment, i've kept the text box a movieclip so i can keep the formatting, and scripted the up and down buttons to move to the next frame of the motion tween, except this hasn't worked it doesn't move on to the next frame.

              • 4. Re: how do i make a scrolling text box?
                Ned Murphy Adobe Community Professional & MVP

                I don't know for sure what you are using, but when you mention moving to frames I figured I'd suggest this at least... scrolling, the way you started off, is usually done by controlling the _y property of an object.  Clicking an up or down button would increment/decrement the value of the masked movieclip's _y property.  If you have a slider-type of control, that would be involved with an enterframe function that tests the location of the slider and adjusts the movieclip's _y property proportionally.  The tricky part starts when you use the buttons and want the slider part to adjust... not necessarily a biggy though.

                2 people found this helpful
                • 5. Re: how do i make a scrolling text box?
                  gotoAndExplore Level 1

                  i've got the nextFrame and prevFrame scripts working now, i'd only missed the brackets from those functions. i've also gotten the slider to respond to the button clicks of the up and down arrow by setting up a motion tween for the slider, so it actually works, just along with nextFrame and prevFrame functions. i've also put the slider button at the same level as the text movieclip

                   

                  but what i do still need is to be able to control the slider button directly, so the user can drag it up and down and the text responds accordingly, like you said using the enterFrame function, but i don't really understand event listeners and that sort of thing, yet.