8 Replies Latest reply on Apr 18, 2006 9:03 AM by Saymaad_Mansoor

    Use of Scrollbar for movieclips

    Saymaad_Mansoor
      I have created a script that duplicates movieclip in an other movieclip with instance "mainmovie_mc" the problem is just that mostly the clip becomes bigger then the stage can some please give me a script or tell me how to create one that checks the movieclip after every duplication and if the clip size is more then 700 px it creates a scrollbar for viewing the clips that are below like windows explorer I hope I made sense
        • 1. Re: Use of Scrollbar for movieclips
          kglad Adobe Community Professional & MVP
          you can make a scrollbar and have it control all the movieclips that are on the _root timeline (including ones that may be on-stage before you begin to scroll and will be moved off-stage by your scrolling). is that what you want?

          and is there some reason that you want your movieclips to increase in _width and/or _height?
          • 2. Re: Use of Scrollbar for movieclips
            Saymaad_Mansoor Level 1
            in the main timeline I have a moviclip instance "userpane_mc" I want to use a scroll bar for it cause under this movieclip there are many sub movieclips that are dupliacted by reading an external text file whose size is unpredictable.
            In short how can I use a scrollbar with a movie clip and tell the scrollbar if the movieclip is more then xx by yy pixels show scrollbar please some help with a script !
            • 4. Re: Use of Scrollbar for movieclips
              Saymaad_Mansoor Level 1
              I previously saw this during the search but how can I use this in component a little guidenece would really be appriciated .
              • 5. Re: Use of Scrollbar for movieclips
                kglad Adobe Community Professional & MVP
                what's the code that creates the sub movieclips that you need to scroll.
                • 6. Re: Use of Scrollbar for movieclips
                  Saymaad_Mansoor Level 1
                  Here is the code of the movieclip in which other movieclips are duplicated please if you can fix some bugs which causes the loaded images in "sam_mc" flicker and dissapper also I was unable to use for and next loop cause this is my first script and I can't get it working please help me out :

                  quote:


                  _root.createEmptyMovieClip("target_mc", _root.getNextHighestDepth());
                  loadVariables("..\\..\\Bin\\user.img", _root.target_mc);
                  function checkParamsLoaded() {
                  _root.ad1 = _root.target_mc.ad1
                  _root.ad2 = _root.target_mc.ad2
                  _root.ad3 = _root.target_mc.ad3
                  _root.ad4 = _root.target_mc.ad4
                  _root.ad5 = _root.target_mc.ad5
                  _root.ad6 = _root.target_mc.ad6
                  _root.ad7 = _root.target_mc.ad7
                  _root.ad8 = _root.target_mc.ad8
                  _root.ad9 = _root.target_mc.ad9
                  _root.ad10 = _root.target_mc.ad10
                  img_mc._x = 360;
                  img_mc.name = _root.ad1
                  loadMovie("..\\..\\Bin\\" + _root.ad1 + ".jpg", img_mc.sam_mc);
                  img_mc.sam_mc._height = 48
                  img_mc.sam_mc._width = 48
                  if (_root.ad2 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "newImg_mc", this.getNextHighestDepth());
                  newImg_mc._x = 360;
                  newImg_mc._y = 160;
                  newImg_mc.name = _root.ad2
                  loadMovie("..\\..\\Bin\\" + _root.ad2 + ".jpg", newImg_mc.sam_mc);
                  //----------------------------------------------------------------------------
                  if (_root.ad3 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "newaImg_mc", newImg_mc.getDepth() + 50);
                  newaImg_mc._x = 360;
                  newaImg_mc._y = 232;
                  newaImg_mc.name = _root.ad3
                  loadMovie("..\\..\\Bin\\" + _root.ad3 + ".jpg", newaImg_mc.sam_mc);
                  //----------------------------------------------------------------------------
                  if (_root.ad4 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "neqImg_mc", newaImg_mc.getDepth() + 50);
                  neqImg_mc._x = 360;
                  neqImg_mc._y = 304;
                  neqImg_mc.name = _root.ad4
                  loadMovie("..\\..\\Bin\\" + _root.ad4 + ".jpg", neqImg_mc.sam_mc);
                  }
                  //----------------------------------------------------------------------------
                  if (_root.ad5 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "neeImg_mc", neqImg_mc.getDepth() + 50);
                  neeImg_mc._x = 360;
                  neeImg_mc._y = 376;
                  neeImg_mc.name = _root.ad5
                  loadMovie("..\\..\\Bin\\" + _root.ad5 + ".jpg", neeImg_mc.sam_mc);
                  }
                  //----------------------------------------------------------------------------
                  if (_root.ad6 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "nebImg_mc", neeImg_mc.getDepth() + 50);
                  nebImg_mc._x = 360;
                  nebImg_mc._y = 448;
                  nebImg_mc.name = _root.ad6
                  loadMovie("..\\..\\Bin\\" + _root.ad6 + ".jpg", nebImg_mc.sam_mc);
                  }
                  //----------------------------------------------------------------------------
                  if (_root.ad7 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "neoImg_mc", nebImg_mc.getDepth() + 50);
                  neoImg_mc._x = 360;
                  neoImg_mc._y = 520;
                  neoImg_mc.name = _root.ad7
                  loadMovie("..\\..\\Bin\\" + _root.ad7 + ".jpg", neoImg_mc.sam_mc);
                  }
                  //----------------------------------------------------------------------------
                  if (_root.ad8 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "negImg_mc", neoImg_mc.getDepth() + 50);
                  negImg_mc._x = 360;
                  negImg_mc._y = 16;
                  negImg_mc.name = _root.ad8
                  loadMovie("..\\..\\Bin\\" + _root.ad8 + ".jpg", negImg_mc.sam_mc);
                  }
                  //----------------------------------------------------------------------------
                  if (_root.ad9 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "nemImg_mc", negImg_mc.getDepth() + 50);
                  nemImg_mc._x = 360;
                  nemImg_mc._y = 592;
                  nemImg_mc.name = _root.ad9
                  loadMovie("..\\..\\Bin\\" + _root.ad9 + ".jpg", nemImg_mc.sam_mc);
                  }
                  //----------------------------------------------------------------------------
                  if (_root.ad10 == undefined) {
                  //nothing
                  } else {
                  duplicateMovieClip(img_mc, "neemImg_mc", nemImg_mc.getDepth() + 50);
                  neemImg_mc._x = 360;
                  neemImg_mc._y = 664;
                  neemImg_mc.name = _root.ad10
                  loadMovie("..\\..\\Bin\\" + _root.ad10 + ".jpg", neemImg_mc.sam_mc);
                  };
                  //----------------------------------------------------------------------------
                  };
                  clearInterval(param_interval);
                  };
                  };
                  var param_interval:Number = setInterval(checkParamsLoaded, 50);
                  stop();


                  • 7. Re: Use of Scrollbar for movieclips
                    kglad Adobe Community Professional & MVP
                    i think you have a number of errors in that coding that will cause problems. i've summarized what i think you're trying to do in a for-loop, but have included a number of problems (and comments) that need to be addressed:
                    • 8. Use of Scrollbar for movieclips
                      Saymaad_Mansoor Level 1
                      Sorry for the inconvinience I have recommented all lines with what I want them to do, here have a look :

                      quote:


                      _root.createEmptyMovieClip("target_mc", _root.getNextHighestDepth()); //Creates an Empty movieclip which will load all variables from the file
                      loadVariables("..\\..\\Bin\\user.img", _root.target_mc); //Loads variables from a relative path
                      newaImg_mc_yA = [0, 160, 232, 304, 376, 448, 520, 16, 592, 664]; //don't know what this does ?
                      img_mc._x = 360; // sets the x-axes of the first clip
                      img_mc.name = _root.ad1; // loads name in the first clip
                      img_mc.sam_mc.loadMovie("..\\..\\Bin\\"+_root.ad1+".jpg"); // this line will load a jpg file from a relative the file name will be variable ad1 + .jpg
                      img_mc.sam_mc._height = 48; // if above file is completed then set the clips height
                      img_mc.sam_mc._width = 48;
                      function checkParamsLoaded() {
                      for (var i = 1; i<=10; i++) {
                      _root["ad"+i] = _root.target_mc["ad"+i]; //loads all variable from _root.target_mc to _root
                      if (_root["ad"+i] != undefined) { // check if current username was not found then stop this if loop
                      duplicateMovieClip(img_mc, "newImg" +i "_mc", this.getNextHighestDepth()); // duplicate img_mc
                      newImg _mc._x = 360; // set the x position of the duplicated clip
                      newImg
                      _mc._y = newaImg_mc_yA[i+1]; // set the y position of the duplicated clip
                      newImg _mc.name = _root["ad"+i]; //sets the name vaariable in the duplicated clip
                      newImg
                      _mc.sam_mc.loadMovie("..\\..\\Bin\\"+_root["ad"+i]+".jpg"); // this will load a jpg file similer to the username variable in a child clip under the duplicated clip
                      }
                      }
                      // clearInterval(param_interval); I want to stop this interval as soon as all variables and jpgs are loaded
                      }
                      var param_interval:Number = setInterval(checkParamsLoaded, 50);
                      stop();



                      and thats all the scrollbar I wanted was to be used with main clip that contains these duplicated clips I also tried the scrollpane but I eats my movies background.
                      And thnx alot kglad for reading and helping, plz fix this cause I simply don't know scripting :-(

                      Edit : here is the link to an illustrated image what my movie does :
                      http://img96.imageshack.us/my.php?image=illustrated8vo.jpg