6 Replies Latest reply on Apr 27, 2006 10:09 AM by zulanwar786

    Scrolling Multiple Dynamically Loaded Text Fields

    zulanwar786
      Greetings,

      I would like to know how one could go about scrolling mulitple dynamically loaded text fields in the same scroll bar.

      So far I have been able to dynamically load one text file successfully with a scroll bar, but I would like to load various text fields and later down the road, to also scroll various mc buttons that are also dynamic.

      Thank you.
        • 1. Re: Scrolling Multiple Dynamically Loaded Text Fields
          kglad Adobe Community Professional & MVP
          attach code to your scrollbar so it controls the scroll property of each textfield that you want it to scroll and execute that code each time you define the text property for those textfields.

          likewise, execute code for scrollbar that controls the _x or _y property (or both) of the movieclips that you want to scroll, after the movieclips are instantiated.
          • 2. Re: Scrolling Multiple Dynamically Loaded Text Fields
            zulanwar786 Level 1
            Right now the code attached to my scroll bar is as follows, which is based off of Kirupa.com tutorial "Scrolling Dynamically Loaded Text":

            http://www.kirupa.com/developer/mx/dynamic_scroller.htm

            Code is as Follows:

            loadText = new LoadVars();
            loadText.load("kirupa.txt");
            //creating the loadVarsText function
            loadText.onLoad = function() {
            scroller.text = this.kirupatext;
            };



            How would I code it to control just the property of each text field I want in the scrollbar?
            How do you define the text property for each field?

            I appreciate your help very much.
            • 3. Re: Scrolling Multiple Dynamically Loaded Text Fields
              kglad Adobe Community Professional & MVP
              create an array of the textfields that you want your scrollbar to control. only add (push) textfields to the array after the text property is assigned (which you did in your code above when you used scroller.text=this.kirupatext). you can then use:

              • 4. Re: Scrolling Multiple Dynamically Loaded Text Fields
                zulanwar786 Level 1
                Thank you very much for the code and instructions.

                I understand how this would control the scrolling of the text fields inside the scrollbar itself which is very helpful to me.

                I am wondering how you would then go about dynamically loading into the scrollbar the dynamic text fields that are descriptions in this case, and the text that will go on mc buttons that correspond to the description. Would I also make a parallel array of these because each mc button will correspond with a description below it. I I plan to have the same layout for different sections of the flash movie, that is why I would like the text on the mc butttons and text fields to be dynamic, in order to change depending on what page the user is on.

                Would I be able to store each of the text field descriptions and the text being displayed on each of the buttons in the same external document and place code on the scrollbar to call particular button titles and descriptions when needed? If so, how would I go about doing that?

                I also created a scrollbar using the UI Scrollbar component which I learned automatically scrolls when the content overflows the box, if I use this component for my scrollbar and dynamically load the other contents into it, would I still use the code you sent me with the arrays?

                Thank you again.
                • 5. Re: Scrolling Multiple Dynamically Loaded Text Fields
                  kglad Adobe Community Professional & MVP
                  are you asking how to load text from an external text file and use that to populate your textfields?

                  and if you use a component, like the scrollbar component, you would not use the code given above. components contain their own code that's used by them.
                  • 6. Scrolling Multiple Dynamically Loaded Text Fields
                    zulanwar786 Level 1
                    Yes.
                    Sorry if my explanations are a bit confusing.