9 Replies Latest reply on May 29, 2007 2:11 PM by Mac_Master1985

    loading jpgs

    Mac_Master1985
      im trying to call a series of 10 jpgs near eachother along the x axes. i want them to come up near eachother. the problem is that only the 10th pic is coming up. can anyone help please?

      thanks in advance

      here is the code:

      var x = 1;
      var xes = 0;
      var dept = 1;
      while (x<10) {
      _root.createEmptyMovieClip("image", dept);
      _root.image.loadMovie("tfs/scroll/"+x+"big.jpg");
      _root.image._x = xes;
      _root.image._y = 0;
      x++;
      dept++;
      xes = xes + 10;
      }
        • 1. loading jpgs
          Greg Dove Level 4
          try changing:
          _root.createEmptyMovieClip("image", dept);

          to:
          _root.createEmptyMovieClip("image"+x, dept);

          oops hang on there's more...working on it
          • 2. Re: loading jpgs
            Greg Dove Level 4
            Haven't tested it, but this should work:

            var x = 1;
            var xes = 0;
            var dept = 1;
            while (x<10) {
            var imageclip = _root.createEmptyMovieClip("image"+x, dept);
            imageclip.loadMovie("tfs/scroll/"+x+"big.jpg");
            imageclip._x = xes;
            imageclip._y = 0;
            x++;
            dept++;
            xes = xes + 10;
            }
            • 3. Re: loading jpgs
              Mac_Master1985 Level 1
              You're amazing!:) thanks alot man!i have been working on this for the last 3 days! tnx alot for your help! it worked perfectly!
              • 4. Re: loading jpgs
                Greg Dove Level 4
                You're welcome
                • 5. Re: loading jpgs
                  Mac_Master1985 Level 1
                  sorry to bother you once again, but i need this sequence to go in a scrollbar. and im trying to make it work in the movie clip of the scroll bar and its not working. let say that the scroll bar's movie is called "scroll" will the code be like this?:

                  var x = 1;
                  var xes = 0;
                  var dept = 1;
                  while (x<10) {
                  var imageclip = _root.scroll.createEmptyMovieClip("_root.scroll.image"+x, dept);
                  _root.scroll.imageclip.loadMovie("tfs/scroll/"+x+"big.jpg");
                  _root.scroll.imageclip._x = xes;
                  _root.scroll.imageclip._y = 0;
                  x++;
                  dept++;
                  xes = xes + 10;
                  }

                  by any chance do you know of a simple horizontal scroll bar?

                  thanks again
                  • 6. Re: loading jpgs
                    Greg Dove Level 4
                    var x = 1;
                    var xes = 0;
                    var dept = 1;
                    while (x<10) {
                    var imageclip = _root.scroll.createEmptyMovieClip("image"+x, dept);
                    imageclip.loadMovie("tfs/scroll/"+x+"big.jpg");
                    imageclip._x = xes;
                    imageclip._y = 0;
                    x++;
                    dept++;
                    xes = xes + 10;
                    }

                    Something like the above should load them into the scroll clip. After that you need a scroll bar or some other approach to move the scroll clip itself which is just really a container for all your loaded images. I guess maybe you could use the UIScrollbar component but I've never done that. A lot of image viewers implement arrows at both ends of an image strip with the images scrolling between them. In this case you would need a clip in the middle which masks the scroll clip between the arrows.
                    • 7. Re: loading jpgs
                      Mac_Master1985 Level 1
                      im sorry to be a pain but the objects are not coming up...i thought its because of the positioning but i tried alot of x values but non of them worked. here is the code once again:

                      var x = 1;
                      var xes = 0;
                      var dept = 1;
                      while (x<10) {
                      var imageclip = _root.text2.content2.createEmptyMovieClip("image"+x, dept);
                      imageclip.loadMovie("tfs/scroll/"+x+"big.jpg");
                      imageclip._x = xes;
                      imageclip._y = 0;
                      x++;
                      dept++;
                      xes = xes + 134;
                      }

                      ps: the text2 movie clip is where i have the mask and the scroll bar and content2 is where i have the wish to load the pics in.

                      if u want i could email you the file and have a look at it.
                      • 8. Re: loading jpgs
                        Greg Dove Level 4
                        OK, that might be easier. I'll send you my email address.
                        • 9. Re: loading jpgs
                          Mac_Master1985 Level 1
                          my email is macmaster1985@gmail.com just send me your email there pls. tnx