5 Replies Latest reply on May 15, 2008 11:18 PM by jmichae1

    UIScrollBar - how? tutorial doesn't work

    jmichae1 Level 1
      I don't know what be added to the Flash 8 UIScrollBar manual's examples, skimpy as it is, but if so, what?
      I can't get the example to work. I of course put in a path to a real text file rather than their URL (helpful, guys).
      when I do a test movie, the text appears and scrolls, but no scrollbar appears.

      I even imported the StandardComponents.fla and copied the ScrollBar assets folder into my library.

      nobody said what you are supposed to do after that. I would be happy to have the default scrollbar.

      I even used actionscript to set the scrollbar object's graphics symbols. nothing.
        • 1. Re: UIScrollBar - how? tutorial doesn't work
          rlc5611 Level 1
          I found nine pages of information in the Flash help file chock full of examples on how to use and customize the scrollbar. Have you used the left and right arrows at the bottom of the help window to page through the information?

          "I even imported the StandardComponents.fla and copied the ScrollBar assets folder into my library. "

          Why would you do that? All you have to do is place the component in the library. Attached is the sample script for the "UIScrollBar.scroll". Note what it says at the very top - "Requires: - UIScrollBar component in library".

          If you run this script without the component in the library, the text will scroll but no scrollbar appears. If you run this script WITH the component in the library, it works a trick (and the scrollbar does appear).

          • 2. Re: UIScrollBar - how? tutorial doesn't work
            jmichae1 Level 1
            UIScrollBar is not in the library of a blank document. nor do I know where to find it or what to do with it to make it work. so I am back to square 1. help.
            • 3. Re: UIScrollBar - how? tutorial doesn't work
              jmichae1 Level 1
              I found the UIScrollbar documentation I needed in the section "Using the UIScrollBar component, where it states "Then create a text input field on the Stage and drag the UIScrollBar component from the Components panel to any quadrant of the text field's bounding box."

              great. now I have a textbox that scrolls, the scrollbar actually appears, but I think I followed the directions correctly - I placed the objects on the scene, I even named them, gave them a class, etc.

              but the code they gave creates yet another uiscrollbar and another textbox right on top. what a mess. it would be nice to be able to drag, drop, and use. but I don't know how. the components don't appear to be visible at runtime.
              • 4. Re: UIScrollBar - how? tutorial doesn't work
                jl2000 Level 1
                HI -
                I don't know if you're still in scrollbar hell (I don't see you standing next to me) but in case you are I might be able to help. If you use the code provided by ric5611 you do not have to draw a textfield on the stage and you do not have to drag a UIScrollBar component onto the stage - you only need the component in your Library. With this method you will not see the TF with SB until you publish the swf. IS this what you want? Have you gotten this far?
                jl
                • 5. Re: UIScrollBar - how? tutorial doesn't work
                  jmichae1 Level 1
                  I have that with this code
                  // *
                  // Requires:
                  // - UIScrollBar component in library
                  //
                  // Create text field.



                  this.createTextField("txt", 10, 0, 0, 600, 480);
                  txt.wordWrap = true;
                  this.createClassObject(mx.controls.UIScrollBar, "sc", 20);
                  // Set the target text field for the scroll bar.
                  sc.enabled=true;
                  sc.visible=true;
                  sc.setScrollTarget(txt);
                  //size it to match the text field.
                  sc.setSize(29, txt._height);
                  //move it next to the text field.
                  sc.move(txt._x+txt._width, txt._y);
                  // Load text to display and define onData handler.
                  sc.upArrowUpName('uparrow');
                  sc.upArrowOverName('uparrow');
                  sc.upArrowDownName('uparrow');
                  sc.downArrowUpName('downarrow');
                  sc.downArrowOverName('downarrow');
                  sc.downArrowDownName('downarrow');
                  sc.scrollTrackName('track');
                  sc.scrollTrackOverName('track');
                  sc.scrollTrackDownName('track');
                  sc.thumbTopName('thumb');
                  sc.thumbMiddleName('thumb');
                  sc.thumbBottomName('thumb');
                  sc.thumbGripName('thumb');

                  var my_lv:LoadVars = new LoadVars();
                  my_lv.onData = function(src:String) {
                  if (src != undefined) {
                  txt.text = src;
                  } else {
                  txt.text = "Error loading text.";
                  }
                  };
                  my_lv.load(" http://www.jesusnjim.com/code/gpl.txt");

                  but all the customizations to the scrollbar do not work as advertised. I remember reading that in order to customize a scrollbar, you must draw each of 30 pieces manually (ugh).

                  now if only I could scroll graphic buttons. I can't even wrap my head around that one.