6 Replies Latest reply on May 17, 2010 8:08 AM by Graham vdR

    Looping movie-clip: contents not clickable after first loop

    Graham vdR Level 1

      Hi there

       

      I have a movie clip (scrollBar) in my site that contains a line of other movie clips moving across the stage (scrollContent1-4). Only two of these are visible at a time, so I have lined them all up, repeated the first two at the end, and have the animation looping.

       

      I want each of the scrollContent1-4 clips to be clickable. It's all fine on the first loop, but once the clip reaches the end and returns to frame 1 the clips are no longer clickable.

       

      Any ideas why this might be so, and how to fix it?

       

      Any help would be appreciated.

       

      (I'm using AS2, Flash CS3 on a Mac)

        • 1. Re: Looping movie-clip: contents not clickable after first loop
          Ned Murphy Adobe Community Professional & MVP

          Where, when is the code for clicking the objects assigned?

          • 2. Re: Looping movie-clip: contents not clickable after first loop
            Graham vdR Level 1

            I have an AS layer in the main timeline. This is the relevant bit of code:


            scrollBar.scrollContent1.onRelease = scrollBar.scrollContent5.onRelease =  function(){
                 _global.ApplicationManager.sendToPage();
            }
            scrollBar.scrollContent2.onRelease = scrollBar.scrollContent6.onRelease =  function(){
                 _global.ApplicationManager.sendToPage();
            }
            scrollBar.scrollContent3.onRelease = function(){
                 _global.ApplicationManager.sendToPage();
            }
            scrollBar.scrollContent4.onRelease = function(){
                 _global.ApplicationManager.sendToPage();
            }

             

             

            When it didn't work I changed the second instances of scrollContent1 and scrollContent2 to scrollContent5 and scrollContent6 respectively, but I don't think it made a difference. What I find most confusing is that it all works on the first loop, but not subsequently.

            • 3. Re: Looping movie-clip: contents not clickable after first loop
              Ned Murphy Adobe Community Professional & MVP

              Where, when is the code for clicking the objects assigned?

               

              If you have instances on different keyframes, the code needs to be where the instances are.

              • 4. Re: Looping movie-clip: contents not clickable after first loop
                Graham vdR Level 1

                My main timeline has a keyframe in frame 1 that acts only to send the user to frame 5 if the page is turned to. Frame 5 is where all the other content (including the AS) is located.

                 

                (It's probably worth mentioning that I'm preparing this for an online publishing platform. The _global.ApplicationManager.sendToPage() function references that platform. I'll put in the actual page numbers when I know them.)

                 

                On frame 5 I have scrollBar, an instance of the ScrollBar movie clip. This contains the Tween 3 graphic which in turn contains all of the scrollContent# instances of the respective ScrollContent# movie clips. The ScrollBar movie clip has its own timeline (the motion tween of the Tween 3 graphic) but no AS.

                 

                With the exception of the stop() and gotoAndPlay() functions in frame 1 and within some of the other movie clips on the stage, all the AS is in its own layer in frame 5 of the main timeline.

                 

                At this stage I haven't inserted the page numbers to direct to in the _global.ApplicationManager.sendToPage() function, but the mouse cursor changes to the hand for the first loop of the scrollBar, which makes me think that it's working there. Once it returns to frame 1 of its timeline, however, the cursor stops changing when I mouse over the scrollContent# clips.

                 

                I hope I've explained it all clearly enough! It's all pretty simple stuff, but when I'm trying to explain it to someone who can't see it it becomes a whole lot more complicated…

                • 5. Re: Looping movie-clip: contents not clickable after first loop
                  Ned Murphy Adobe Community Professional & MVP

                  That code you show will only be valid for the instances that are present in frame 1 of the scrollbar movieclip.  If you move to a frame in that movieclip where new instances interupt the instances of frame 1, then your frame 1 instances have lost touch with their code, and moving back to frame 1 won't restore it.  You would have to move back to frame 1 of the scrollbar mc and re-execute the code in frame 5 of the main timeline.

                   

                  If you place the code inside the scrollbar mc rather than on the main timeline, you can probably get things working better without having to juggle different code on different timelines.

                  1 person found this helpful
                  • 6. Re: Looping movie-clip: contents not clickable after first loop
                    Graham vdR Level 1

                    OK, I seem to have sorted it out. In my scrollBar mc I had two layers – one with the scrollContent# movie clips (Tween 3) and one above that with the mask. I had a keyframe at the end of the timeline in the mask layer. I deleted that and it seems to have sorted it all out (even tough there was no AS or anything else on that frame).

                     

                    Thanks for the help!

                     

                    (I have found it quite useful in cases like this to set up a very simple test file and get it as basic as possible. It helps to establish exactly where the problem is, and when I get it working and I can compare the two files and apply the principles of the one to the other.)