6 Replies Latest reply on Dec 10, 2008 3:21 PM by ek-007

    Looping problem

    ek-007
      Any ideas why this code wouldn't be working? Thanks!
        • 1. Re: Looping problem
          Ned Murphy Adobe Community Professional & MVP
          Can you describe what the following two lines are trying to accomplish:

          ["_root.thumbnails_mc.thumbClick"+k+"."]onRelease = function() {
          ["slideCount="+k];

          If I had to guess what the first should be I'd say...

          _root.thumbnails_mc["thumbClick"+k].onRelease = function() {

          but that's just guessing. The second line leaves me fairly clueless
          • 2. Re: Looping problem
            pedro_poc

            Just like Ned said it would be nice to know more about what are you trying to accomplish and where/how are you using this code.

            This would be my guess:

            for(k=0; k<imageArray.length-1; k++) {
            this.thumbnails_mc["thumbClick"+k].onRelease = function() {
            slideCount += k;
            thumbnailVariableManager();
            thumbnailButtonManager();
            controlCenter();
            }
            }

            Cheers
            • 3. Re: Looping problem
              ek-007 Level 1
              Thanks for the tips. I'm getting closer now. Here's a little elaboration about what I'm wanting this code to do. I want the loop to replace this code (see code sample 1).

              ... and so on up to 20 images (it's a photo gallery)

              Ideas? The loop is now referencing the right movie clip on the root timeline, but I think there's something going wrong with the slideCount variable. I now have the loop looking like this (see code sample 2).
              • 4. Re: Looping problem
                pedro_poc Level 1
                ok here we go, try this:
                • 5. Re: Looping problem
                  Ned Murphy Adobe Community Professional & MVP
                  Unless my brain is playing a trick on me at the moment...

                  k<imageArray.length;
                  • 6. Re: Looping problem
                    ek-007 Level 1
                    That did it!! Thanks a lot.