1 Reply Latest reply on Mar 15, 2007 11:47 AM by mclem

    Stop Occurrence of Scroll Bar

    SM6601 Level 1
      I used the following actionscript for a scroll bar to appear on a dynamic text field. Unfortunately, the scroll bar continues to appear on every frame proceeding the frame where the text field is displayed. What is the method to eliminate the occurrence of the scroll bar?
      /**
      Requires:
      - UIScrollBar component in library
      */
      // Create text field.
      this.createTextField("myText", 10, 10, 20, 200, 100);
      myText.wordWrap = true;
      this.createClassObject(mx.controls.UIScrollBar, "my_sb", 20);
      // Set the target text field for the scroll bar.
      my_sb.setScrollTarget(myText);
      // Size it to match the text field.
      my_sb.setSize(16, myText._height);
      // Move it next to the text field.
      my_sb.move(myText._x + myText._width, myText._y);
      // Load text to display and define onData handler.
      var my_lv:LoadVars = new LoadVars();
      my_lv.onData = function(src:String) {
      if (src != undefined) {
      myText.text = src;
      } else {
      myText.text = "Error loading text.";
      }
      };