0 Replies Latest reply on Mar 29, 2007 3:11 PM by digitalhedonist

    SCROLLPANE problem

    digitalhedonist
      I am struggling with an issue with the Scrollpane component. The scrollbar resizes perfectly fine when I create all of the movie clip instances at once using a 'for' loop. But it DOESN'T RESIZE when I have each instance created on a button click. I need to get it working this way.

      /*The following code works:*/

      var i = 1; //index for URL entries
      var URLY = 28;
      var URL_num = 1;
      var URL_list;

      URL_pane.onLoad = function() {

      this.contentPath = "URLPaneBG"; //movie clip linkage name
      URL_list = this.content;

      //create movie clip instances
      for (var i = 0; i < 50; i++) {
      URL_list.attachMovie("URLEntry", "URLEntry"+i, i);
      URL_list["URLEntry"+i]._x = 0;
      URL_list["URLEntry"+i]._y = URLY;
      URL_list["URLEntry"+i].URL_num.text = URL_num;

      URLY += 28;
      URL_num++;
      }
      }


      /*The following code does NOT work:*/

      var i = 1; //index for URL entries
      var URLY = 28;
      var URL_num = 1;
      var URL_list;

      URL_pane.onLoad = function() {

      this.contentPath = "URLPaneBG"; //movie clip linkage name
      URL_list = this.content;
      }

      addURL_btn.onRelease = function() {

      URL_list.attachMovie("URLEntry", "URLEntry"+i, i);
      URL_list["URLEntry"+i]._x = 0;
      URL_list["URLEntry"+i]._y = URLY;
      URL_list["URLEntry"+i].URL_num.text = URL_num;

      //trace(URL_list._height);

      i++;
      URLY += 28;
      URL_num++;
      }


      I'd greatly appreciate some help on this.

      Thanks!