0 Replies Latest reply on Jun 7, 2007 8:46 AM by olally

    Working with Scroll Pane

    olally
      Hi There,

      I have the following items on the stage in the first keyframe ::
      1) ScrollPane with instance name: "sp"
      2) input text with instance name: "addClass_txt"
      2) button with instance name: "add_btn" with label "additem"

      I have 2 movie clips in the library: "rowParent" , "empty"

      Im trying to attach "rowParent" MC to SP dynamically when click a button "addItem"

      I have the following code in the first key frame ::
      stop();
      sp.contentPath = "empty";
      var layer = 1;
      var rowCont = 1;
      var classMCArr:Array = new Array();
      add_btn.onRelease = function() {
      addClass("test1234");
      };
      function addClass(cls:String) {
      var mc = sp.content.attachMovie("rowParent", "rowParent"+rowCont++, layer++);
      classMCArr.push(mc);
      mc.class_txt.text = cls;
      if (rowCont == 2) {
      mc._y = 0;
      } else if (rowCont>2) {
      mc._y = (mc._height*(rowCont-2));
      }
      }


      // Im able to attach "rowParent" MCs when I click on the "additem" button .
      // now the problem is the ScrollPane is not showing up the scrollbar when im trying to add more than 5 "rowParent" MCs

      can any one help me in fixing it

      Thanks a tonnnnnnnnn!!!

      Hima